[ITK Community] [Insight-users] modify spacing of an 3D image slice

O Hamo ohamo at live.de
Wed Nov 6 12:40:32 EST 2013


Hello,
I am reading a single image slice belonging to an DICOM CT series.The component type is short and number of dimension is 3.Now I want to modify the voxel spacing.To do that I tried this:	double newSpacing[3];	newSpacing[0] = x_spacing;	newSpacing[1] = y_spacing;	newSpacing[2] = z_spacing;	reader->GetOutput()->SetSpacing(newSpacing);but this will modify only x- and y-spacing while z remains the same (=1mm)Also writing z_spacing to the header entry 0018,0050 (Slice Thickness) won`t change the fact, that calling GetSliceSpacing() at the resulting image will return the values of x-and y-spacing but still 1 instead of z-spacing.
How can the 3rd spacing component be modified?Is this even possible for the givien image?Because Im assuming that ITK is calculating the spacing by using ImagePositionPatient(0020,0032) and ImageOrientationPatient(0020,0037), but sets it by default to 1 when it cant find more than one slice. (Just a guess)
Any help is apreciated.
Kind Regads,Omar 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20131106/0581f1ea/attachment.html>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users


More information about the Community mailing list