[Insight-users] FastMarchingImageFilter seg fault = Negative Spacing

Luis Ibanez luis.ibanez@kitware.com
Tue, 28 Jan 2003 10:32:13 -0500


Hi Mathieu,

I see your point...
But I would suggest to make the modification in the
normalization of the Gaussians.

We may want to keep a consistent spacing signs, in
particular if you are interested in doing registration
with this image. Spacing will be used to map world
coordinates to grid points. A negative spacing put the
image reflected over the origin. The interpolators,
metrics and resampling filters will use this for
computing positions.

Now, in registration we compute Metrics derivatives by
multiplying the Jacobian of the transform by the Gradient
of one of the images. The Jacobian of the transform will
be using the reflected coordinate system resulting from
negative spacing. If we fabs() the spacing in the derivative
filter this will change the direction of the Metric derivatives.

So,
The RecursiveGaussianFilter has been corrected in order
to use fabs( spacing ) in all the computations, but still
use the spacing sign in the normalization factor.

That should take care of the problem.

Now about other filters... it is good to keep eyes open.
Chances are that many of them are not checking for the
spacing sign.

-----

About the file format ...

ITK is templated over pixel type. There is not restriction
to 8bit data. This particular application is using an input
pixel type of 'signed short' and then promoting it to 'float'
pixel type in order to apply the anisotropic diffusion filters.

So, there is no limitation to 8bit data here, It may rather be
a limitation of the VTKImageIO reader.  Have you tried loading
other image formats ?

Possible choices are : Dicom, MetaImage, Gipl, Analyze.

Please let us know what you find,

Thanks


     Luis


-------------------------------------

Mathieu Malaterre wrote:
> Luis,
>    I am still amazed that you can find time to answer emails and 
> continue developping ITK. Give your trick !
>    Anyway I still have some questions about my preceeding email.
> 
> - What if I add (in itkRecursiveGaussianImageFilter.txx  ):
> m_Spacing = fabs(m_Spacing);    //line 52 before  if( m_Spacing < 
> spacingTolerance)
> 
> this shouldn't make any difference as finite difference are magnitude 
> based.
> What I don't know is if other filters might complain about that. What do 
> you think ?
> 
> - I am using CT image with a scalar range of :(0.0, 870.0). If I read my 
> image in binary or ascii through a python+vtk script this is ok. But 
> when I use RegionGrowingSegmentation there is a difference. 
> RegionGrowingSegmentation can only read properly ascii data file. Is ITK 
> although assuming a range of (0, 255) all over the place ?
> 
> thanks
> mathieu
> 
>