Subhajit
Subhajit

Reputation: 43

Image segmentation and registration using SimpleITK

I have some doubts regarding 3D image registration and segmentation:

  1. Load dicom images: In DCE-MRI there are 4000 slices and total 100 stacks, so 40 in each stack. How can I load them to a 4D array using GDCM simpleITK function

  2. Registration: registration is pretty straight forward, we have to register all 100 stacks to the first stack.

  3. Registration accuracy : SimpleITK overlap ratio measure or hausdroff distance need segmentation and labelling. Now segmentation using region growing or thresholding is not easy for all kind of images. Let suppose I just want to select a region manually , interactively. Is it possible to achieve that ? Then I just want to use that selected mask for registration accuracy evaluation.

  4. Visualization and write : need to visualize in 3D using matplotlib or VTK. All plot functions are working for 2d slice, again visualizing in 2D is not desired. While writing to a dicom image using simpleITK write Image function, for dicom image just writing the image object is not working. We need to change type to UInt32 , but then the image becomes lossy. It successfully writes to a .mha format, but imageJ fails to display.

If possible please share your thoughts.

Upvotes: 0

Views: 2581

Answers (3)

user3216191
user3216191

Reputation: 123

3D Slicer has functionality to load DCE MRI series as 4D volumes. You can find the tutorial how to use this functionality of 3D Slicer in this post: https://discourse.slicer.org/t/how-to-analyze-dce-mri-data/622.

Upvotes: 0

fati
fati

Reputation: 135

1) GetImageFromArray, simpleITK in python> convert a 4d numpy array to a SimpleITK image.

import numpy as np
import SimpleITK as sitk

np_array = np.zeros( (a,b,c,d) )
tdim = np_array.shape[3]
slices = []

for i in range(tdim):
    slices.append( sitk.GetImageFromArray( np_array[i], False ) )

im = sitk.JoinSeries(slices)

sitk.WriteImage(im, "imageresult.mha") 

2) You can first select you VOI using ITKsnap, or in your python code and instead of performing all your experiments on the whole image data, you can only include that ROI.

3) use> from myshow import myshow

myshow(sitk.LabelToRGB(img), title='img')

Upvotes: 0

Dženan
Dženan

Reputation: 3395

I am not sure whether SimpleITK supports 4D images in its default configuration. If not, you would have to compile it yourself, after having it configured to support dimension 4 (and not just 2 and 3). Even with that, I am not sure it would work right away - DICOM is notorious making simple things not so easy, and complicated things super-hard.

ITK-SNAP is a tool for manual and manually assisted segmentation.

Visualization is more a VTK question. Here is an example which uses 3D visualization.

Upvotes: 0

Related Questions