[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://www.itk.org/pipermail/insight-users/attachments/20131106/0581f1ea/attachment.htm>


More information about the Insight-users mailing list