[Insight-users] Compute the overlapping volume of two images
Luis Ibanez
luis.ibanez at kitware.com
Fri Nov 9 16:08:24 EST 2007
Hi Michael,
Here is one possible method:
1) Take a ResampleImageFilter
2) Connect one image as the input image
3) Connect the other image as the Reference image
4) Fill the buffer of the input image with "1"s
5) Set the default value of the Resample filter to "0"
6) Set an itkIdentiyTransform to the ResampleImageFilter
7) Set a NearestNeighborhood interpolators
8) Run the filter (e.g. resample the image)
9) Take the output image
10) Count the number of pixels that are non-zero
11) If you want to get mm3,
take the number from (10) and multiply it by
ImageType::SpacingType spacing = image->GetSpacing();
double pixelVolume = spacing[0] * spacing[1] * spacing[3];
Regards,
Luis
------------------------
Michael Schildt wrote:
> Hello Everybody!
>
> I register two anatomical MRI datasets using regid registration. I have
> something like a gold standard for the moving image. And I want to
> compare my standard image and the actual result of a registration. So, i
> have two identical images except their positioned in space. To get a
> number reflecting how good the two images cover the same volume, i would
> like to compute their common volume (in number of pixel of one image or
> volume in mm³).
> I looked around in the itkSoftwareGuide, the itkDoxygen-Stuff and the
> user list. But didn't really find a way to go.
>
> I thought about something like:
> 1) create two SpatialObjects (one box for each image, but didn't found
> an BoxSpatialObject) and compute the intersection (don't know how) and
> then .... don't know
> 2) iterate through all pixel of one image, compute their position in
> space, test the position for the other image with the IsInside()
> function of ImageSpatialObject and simply count the pixels. But actually
> this will only be a aorund about number, because it uses nearest
> neighbour selection.
>
> Is their something inside ITK that can help me with this issue?
>
> Best regards,
> Michael Schildt
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
More information about the Insight-users
mailing list