Image segmentation and registration using SimpleITK

谁说胖子不能爱 提交于 2019-12-12 04:28:58

问题


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.


回答1:


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.




回答2:


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')



回答3:


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.



来源:https://stackoverflow.com/questions/42943272/image-segmentation-and-registration-using-simpleitk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!