[Insight-users] Can metrics handle nodata/void data values ?
Luis Ibanez
luis . ibanez at kitware . com
Tue, 09 Sep 2003 14:36:51 -0400
Hi Carolyn,
Thanks for the clarification.
That actually raises a good point: We will need two masks
instead of one. In that way one mask can be associated to
the fixed image space and the other to the moving image
space.
---
Now that, on the pragmatic side:
You probably already have assigned a distinct gray value
to the pixels that you know are "void".
You can make a "minimally invasive intervention" in the
itkNormalizedCorrelation ImageToImageMetric and/or
the itkMeanSquaresImageToImageMetric.
Simply go to the loop that iterates over the pixels of the
fixed image and add an "if()" that test for the "void" pixel
value.
For the moving image you have two options
1) the easy option
2) the correct option
3) the elegant option
The easy option is to use nearestneighbor interpolator,
and let the interpolator get the gray value of the moving
image for you. Then you test this value against your "void"
value and reject or accept the pixel accordingly.
The correct option requires you to first map the point to the
coordinates of the moving image, then convert Physical point
to index, and finally probe the moving image in order to
obtain the pixel value.
The elegant option involves to built-in this functionality
on the interpolator itself. Part of the work of the interpolator
is to determine if the requirested position is inside or outside
of the image. So, it is natural for the API to also manage
holes inside the image. In this option you could take your
favorite ITK interpolator, copy it, rename it and modify
its code, for the verifiction of being inside or outside.
You will add a check for the pixel value against the code
you user for "void" pixels.
Regards,
Luis
---------------------------
Carolyn Johnston wrote:
>> Hi Carolyn,
>>
>> I probably missunderstood what you meant by "void" points,
>> or "void" pixels. I assumed that those were pixels where the
>> data is not valid. For example is the image is the result of resampling
>> another image, and some areas didn't got any pixel data. That's common
>> with ultrasound images.
>>
>> Could you explain why the "void" pixels will keep changing ?
>> Shouldn't they be the same during the entire registration process ?
>>
>> Thanks
>>
>> Luis
>
>
>
> No, you have the right idea, although my images tend to be shot
> through with little clumps of void data here and there.
>
> I am not saying that the locations of the void pixels in *image* space
> will change, (they won't) but as different transforms from the
> parameter space are applied, the locations of the moving image's voids
> in the fixed image's frame of reference will change. As I understood
> it, in your previous post you were talking about using a spatial
> object -- referenced to coordinate space, not image space -- to define
> the void mask. But both the fixed and moving images are likely to
> have voids.
>
> Carolyn
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>