[Insight-users] Image Spacing Issue

Luis Ibanez luis . ibanez at kitware . com
Mon, 08 Dec 2003 17:08:19 -0500


Hi Jessica,

The value of pixel spacing is fundamental for the good operation
of the ResampleImageFilter.

http://www . itk . org/Insight/Doxygen/html/classitk_1_1ResampleImageFilter . html

You must make sure that the values of pixel spacing on the input
image are consistent  with the values of pixel spacing that you
are requesting in the ResampleImageFilter with the method

                      SetOutputSpacing()

By "consitent" we don't mean "equal value", but simply to make sure
that they are both expressed in the same lenght units.

Could you give us some details on the type of resampling you are
doing ? Is it a sub-sampling or a super-sampling ?

Notice that we usually talk about "mm" because it is typically the
unit used in CT and MRI images, but ITK doesn't associate any
particular unit to your data. It simply assumes that all the
spacings are in the same length units.

If you are dealing with images from microscopy, it may be more
convenient for you to specify spacings in microns.

 From your message it seems that the actual problem in in the
reading process. Probably the file format that store your images
are not providing the right spacing. (What file format do you use ?).

If you are certain of the spacing value, you could use the
ChangeInformationFilter in order to override the values of the
reader.
http://www . itk . org/Insight/Doxygen/html/classitk_1_1ChangeInformationImageFilter . html

This is efficient but not very elegant. A better solution would be to
use a file format allowing you to store the correct information of
pixel spacing.  One option is to use a MetaImage header for wrapping
your image file (it depends on what image format you are using right
now)


Notice also that for resampling you normally just need the
IdentityTransform, since the values of pixel spacing will do
the rest of the scaling for you.


Please let us know more details about the resampling
that you are trying to perform.


Thanks


   Luis



------------------------
Jessica de Ryk wrote:

>  
>  
> Hi,
> I have noticed that the output from my ResampleImageFilter appears 
> blurry. I believe this has to do with a spacing issue. My images come 
> from a microscope attached to a 1300x1030 CCD camera. I printed out the 
> image spacing via spacing = reader->GetOutput()->GetSpacing() and got 
> that it was reading it as 1mm. I know that the images spacing is around 
> 0.015mm. Passing this value as the spacing gives me a completely black 
> image. Is there any way around this spacing issue.
> Thanks
> Jess
>