[Insight-users] Help - ImageMomentsCalculator Error

Dan Mueller dan.muel at gmail.com
Sun Jan 30 23:30:41 EST 2011


Hi Fauze,

This typically occurs when the input image is black -- all zeros (see
Code/Algorithms/itkImageMomentsCalculator.txx at 151-155). I guess it can
also occur when using a signed image, and all of the pixels add to
zero.

Confirm that the image you are passing the moment calculator has been
correctly read/processed.

HTH

Cheers, Dan

On 31 January 2011 05:18, Fauze Polpeta <fauze.polpeta at gmail.com> wrote:
> Hi;
>
> What leads the ImageMomentsCalculator to output the following error:
>
> Compute(): Total Mass of the image was zero. Aborting here to prevent
> division by zero later on.
>
> This function is called when I try to initialize a
> itk::VersorRigid3DTransform as follows:
>
> =====
>
> typedef itk::CenteredVersorTransformInitializer< ImageType, ImageType>
> TransformInitializerType;
>
> TransformInitializerType::Pointer transformInitializer =
> TransformInitializerType::New();
> transformInitializer->SetTransform(self->transform);
> transformInitializer->SetFixedImage(volume1);
> transformInitializer->SetMovingImage(volume2);
> transformInitializer->InitializeTransform();
>
> Then console outputs:
>
> itk::ERROR: ImageMomentsCalculator(0x1e0af580): Compute(): Total Mass
> of the image was zero. Aborting here to prevent division by zero later
> on.
>
> =====
>
> Regards
>
> Fauze
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list