[ITK] [ITK-users] Bug in CenteredTransformInitializer for RGB solved?

Bradley Lowekamp blowekamp at mail.nih.gov
Wed Jun 25 08:31:27 EDT 2014


Hello,

The error you reported is a compilation error. When compiling all options need to be compiler. The "GeometryOn" option is a run-time options, so while the moments computation is compiled it not actually calculated in this configuration.

Brad

On Jun 25, 2014, at 8:22 AM, Dr. Roman Grothausmann <grothausmann.roman at mh-hannover.de> wrote:

> Dear Brad,
> 
> 
> Many thanks for Your quick reply and the suggested workarounds. I should manage to get going with those.
> However, I still wonder why ImageMoments need to be calculated at all, as I just want to rotate and translate an input image in regard to the image centre, i.e. why does CenteredTransformInitializer calculate ImageMoments when GeometryOn() is specified?
> 
> Thanks gain for Your help.
> Roman
> 
> On 24/06/14 13:41, Bradley Lowekamp wrote:
>> Hello,
>> 
>> The ImageMoments calculator only works with scalar images not RGB. This would be not so much as a bug, but more mathematically not defined.
>> 
>> You can select a single channel if your image with the VectorIndexSelectionCastImageFilter[1], or convert it to Luminance[2][3], or event perform a segmentation and compute the moments on a binary images.
>> 
>> Brad
>> 
>> [1] http://www.itk.org/Doxygen/html/classitk_1_1VectorIndexSelectionCastImageFilter.html
>> [2] http://www.itk.org/Doxygen/html/classitk_1_1RGBToLuminanceImageFilter.html
>> [3] http://www.itk.org/Doxygen/html/classitk_1_1RGBToLuminanceImageAdaptor.html
>> 
>> 
>> 
>> On Jun 23, 2014, at 11:14 AM, Dr. Roman Grothausmann <grothausmann.roman at mh-hannover.de> wrote:
>> 
>>> Dear mailing list members,
>>> 
>>> 
>>> Basically I want to rigit 3D transform an RGB image for which I use the CenteredTransformInitializer with GeometryOn(). However gcc complains:
>>> 
>>> /opt/itk-4.5.1/include/ITK-4.5/itkImageMomentsCalculator.hxx:115:29: error: cannot convert ?const PixelType {aka const itk::RGBPixel<double>}? to ?double? in initialization
>>> 
>>> It seems this was reported in 2005 and judged to be a bug:
>>> http://www.itk.org/pipermail/insight-users/2005-April/012663.html
>>> 
>>> Has this been solved and I'm doing something wrong?
>>> I'd expect that when using GeometryOn() the moments should not matter at all.
>>> 
>>> Any help or hints are very much appreciated
>>> Roman
>>> 
>>> 
>>> 
>>> --
>>> Dr. Roman Grothausmann
>>> 
>>> Tomographie und Digitale Bildverarbeitung
>>> Tomography and Digital Image Analysis
>>> 
>>> Institut für Funktionelle und Angewandte Anatomie, OE 4120
>>> Medizinische Hochschule Hannover
>>> Carl-Neuberg-Str. 1
>>> D-30625 Hannover
>>> 
>>> Tel. +49 511 532-9574
>>> _____________________________________
>>> 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.php
>>> 
>>> 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://public.kitware.com/mailman/listinfo/insight-users
>>> _______________________________________________
>>> Community mailing list
>>> Community at itk.org
>>> http://public.kitware.com/mailman/listinfo/community
>> 
> 
> -- 
> Dr. Roman Grothausmann
> 
> Tomographie und Digitale Bildverarbeitung
> Tomography and Digital Image Analysis
> 
> Institut für Funktionelle und Angewandte Anatomie, OE 4120
> Medizinische Hochschule Hannover
> Carl-Neuberg-Str. 1
> D-30625 Hannover
> 
> Tel. +49 511 532-9574

_____________________________________
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.php

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://public.kitware.com/mailman/listinfo/insight-users



More information about the Community mailing list