vtkMarchingSquares for DICOM *.dcm/png/bmp stack

@lassoan @dgobbi
Continuing the discussion from Stack of PNG files to be rendered as 3D:

I have a similar situation where the data seems 2D+t [typically coronary angiograms], i’m trying to understand “qualitative” flow pattern before and after stent. Raw data is typically DICOM format which is reconstructed and provided in low fidelity formats as movies (mp4/avi).

begun with fullhead15.png [iso set to 500] from the tar ball [source: Contour Triangulator] as well rewrote the [ContourTriangulator.cxx]code in python. Following are the differences i saw.

  1. the Red arrow indicates there are certain area that seems filled ? what factor control this filling of gap/void

  2. how was the original data [fullhead15.png] from the source[?] saved as PNG ? it appears to be a monochromatic scale.
    image

  3. If i’m trying to reuse the executable built from c++ to a sample PNG other than the example[fullhead15.png] it throws the following error

  4. the reference PNG/DCM i have is as following
    image

Any help/suggestion on approaches to read the source from *.dcm/ png and reconstructing 2D+t is greatly appreciated.

PS: i would have uploaded the *.py [ system doesnt allow though for new users].

Loading the 2D+t image sequence from DICOM should not be a problem. Most DICOM readers should be able to handle it. For example, I know that 3D Slicer (recent Slicer Preview Releases for sure) can read an XA image series into a time sequence that you can visualize and conveniently process using VTK filters or access as numpy array.

I would not use png, mp4, avi file formats. They are generally limited to 8 bits, while you need 10 bits if you export native images and want to do the subtraction yourself. In some cases, compression artifacts might cause problems, too. DICOM export might be disabled in your PACS or image review workstation by default, but you can always request a DICOM export via disk or network.

For the rest of your processing (motion compensation, subtraction, masking, temporal filtering, choice of flow or perfusion metrics, etc.) you can ask clinical experts on the 3D Slicer forum.

Thank you @lassoan for your reply.

Will open a new thread on 3D Slicer forum.

Keeping this thread open just in case some one could throw light around reusing to any *.png ContourTriangulator.cxx.
[ContourTriangulator fullhead15.png 500 ]
Alternatively:
readPNG.py (1.8 KB)