Segmentation and Mesh orientation problem

613 views
Skip to first unread message

clamber...@googlemail.com

unread,
Jun 30, 2009, 10:44:58 AM6/30/09
to itksnap-users

I'm using ITK-SNAP (version 1.8) on a windows machine to create manual
segmentations (for ROIs) and meshes. I have encountered several
problems regarding the orientation of images and suspect it is related
to now the header information is being read by ITK-SNAP.

Essentially when I try to upload the manual segmentations and meshes
in any other program (e.g. SPM, MRIcro, DV3D etc.,) I find that the
original structural image used to create the manual segmentations and
the saved mesh/segmentations are no longer in the same space as each
other. I've used spm_get_space to directly compare the two and found
the following:

Original image:
0 0 1.0000 -88.5000
-1.0000 0 0 132.5254
0 1.0000 0 -128.0000
0 0 0 1.0000

ITK-Segmentation:
-1.0000 0 0 120.5000
0 1.0000 0 -128.5000
0 0 1.0000 -88.5000
0 0 0 1.0000

(However when the original image is opened in ITK-SNAP it is read as
having a RSA orientation).

I have attempted to change the space of the ITK-segmentation in spm
(using spm_get_space) and can successfully do so (solving the ROI
problem-but have not found a way to correct the vtk files). However I
then can not get the 'corrected' image to open in ITK and therefore
can not create meshes in the same space as my images and functional
data. Altering the image orientation in ITK-SNAP does not correct the
mesh orientation. I've read through the mailing list and help
documentation but can not find a solution. Does anyone know a way
around this problem?

Many thanks for your help,

- Chris

--
Dr Christian Lambert, Wellcome Trust Clinical Research Fellow,
Wellcome Department of Imaging Neuroscience,
Institute of Neurology,

Paul Yushkevich

unread,
Jun 30, 2009, 11:16:11 AM6/30/09
to itksnap-users
Hi Chris,

Are your SPM-generated files stored with a .nii extension or .img
extension? The .img input/output uses Mayo Analyze compatible code and
can mess up headers. Nifti headers should be preserved.

The vtk meshes are stored in the physical (RAS) coordinate system,
consistent with the Nifti header.

Paul.

On Jun 30, 10:44 am, "clambert112...@googlemail.com"

Christian Lambert

unread,
Jul 1, 2009, 12:30:40 PM7/1/09
to itksna...@googlegroups.com
I've reprocessed the data in .nii format as it was originally in .img - Now the segmentations are correctly orientated but not the mesh (see attached).

Many thanks for your help,

- Chris



problem.jpg

Paul Yushkevich

unread,
Jul 1, 2009, 1:10:40 PM7/1/09
to itksna...@googlegroups.com
Chris

Unfortunately there is no standard as to what coordinate space meshes are saved in. SNAP saves meshes in NIFTI coordinate space, but the tool you are using must assume a different space. You can load meshes in Paraview and apply a spatial transformation to send them into the right space (i.e., take the inverse of the Nifti s-form transform to send the mesh into voxel space). That's the best I can think of at the moment. We could add an option to select what space a mesh is saved in down the road.

Paul


Paul Yushkevich
Research Assistant Professor
Department of Radiology
University of Pennsylvania

3600 Market St., Ste 370
Philadelphia, PA 19104, USA



<problem.jpg>

Lo, Warren

unread,
Aug 10, 2009, 4:28:32 PM8/10/09
to itksna...@googlegroups.com

I’d like to ask the group’s help with a question about processing clinical CTs.  We find that some of the sagittal CT images have a distorted, elongated appearance that is different from the source clinical scan (examples attached).  This is variable; we find this with most of our CT scans, but not all.  We do not see it with MRI scans (example attached). 

 

This distortion does not affect the axial scans that were the source images, which we use for our measurements.  It is unsettling, however, to see that the sagittal projection is distorted.  We don’t see distortions in the MRIcro or ImageJ output after converting axial images from DICOM to ANALYZE files.

 

Is this distortion a problem?  If the program simply has shifted the axial slices along a tilted Z axis, then I can’t imagine that it will give us an erroneous volume measure.  If the distortion is a problem, it is not clear what we can do to fix it. 

 

Thanks for any tips you can give.

 



----------------------------------------- Confidentiality Notice: The following mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. The recipient is responsible to maintain the confidentiality of this information and to use the information only for authorized purposes. If you are not the intended recipient (or authorized to receive information for the intended recipient), you are hereby notified that any review, use, disclosure, distribution, copying, printing, or action taken in reliance on the contents of this e-mail is strictly prohibited. If you have received this communication in error, please notify us immediately by reply e-mail and destroy all copies of the original message. Thank you.

clinical CT sag.jpg
ctsnapsag.png
mrisnapsag.png

Olena Tankyevych

unread,
Jun 27, 2019, 11:47:34 AM6/27/19
to itksnap-users
 I'm using this post as my problems seems similar. I'm working on PET DICOM images that are segmented in ITKSnap, the dicom and the segmentation are saved as Analyze (.img). However, due to the lack of precision in ITKSnap, I convert DICOMs to nifti or to img with Dcm2niix, making sure I get the raw data multiplied by the slope. Further, I apply a SUV correction on the segmentation region of the image, therefore using both Dicom data and segmentation as a mask, all in Python. However, the segmentation that is created in ITKSnap has no longer the same oreintation as Nifti converted by Dcm2Niix. I tried converting segmentation to Nifti instead of Analyze, I still loose the original orientation. I tried changing changing the orientation by hand, no success. 
However, when I open the Nifti image and the segmentation in Slicer, it manages to put in the same space, but when I look at the statistics of the region, it does not match to is expected, so it's kind of fake how Slicer recognizes the position. Also, I tried to save the segmentation with Nifti as  Dicom RT hoping they will be in the same space, no luck either.

I also tried extracting the raw array with Nibabel and using the header and affine transform in either sense trying to bring them to the same space, no luck either.

So, I am stuck with original images truncated by ITKSnap but in the same space as my segmentation, I can apply the SUV factor, but I am loosing precision which is not ideal.

Do you have any suggestions to solve this?

Francisca Ferreira

unread,
Jun 27, 2019, 11:50:36 AM6/27/19
to itksna...@googlegroups.com
Hi all, simple question (im sorry) im trying to visualize some diffusion tractography data (some tracts) and apply a threshold of 20% to the tracts i already have, how can i change the threshold?

thanks,
Francisca
--
Sent from Gmail Mobile
Reply all
Reply to author
Forward
0 new messages