[ITK-users] reading images of vectors with variable length in addition to scalar, RGB, RGBA (itkVectorGradientMagnitudeImageFilter)

Kristen Zygmunt krismz at sci.utah.edu
Mon May 9 16:18:40 EDT 2016


Hi Roman,
    You can also take a look at the Patch Based Denoising Filter that was designed to work with both VectorImage and Image types.  For example, the DispatchedMinMax and DispatchedArrayMinMax methods in Modules/Filtering/Denoising/itkPatchBasedDenoisingImageFilter.hxx are instantiated appropriately to use the NthElementImageAdaptor as necessary to aid in calling filters for certain image types.  You should be also able to uncomment the VectorImage examples in itkPatchBasedDenoisingImageFilterTest.cxx as they will compile now.  

-Kris

> Date: Mon, 9 May 2016 16:21:14 +0200
> From: "Grothausmann, Roman Dr." <grothausmann.roman at mh-hannover.de>
> To: ITK Mailing List <insight-users at itk.org>
> Subject: [ITK-users] reading images of vectors with variable length in
> 	addition to scalar, RGB, RGBA (itkVectorGradientMagnitudeImageFilter)
> Message-ID: <57309CDA.6010108 at mh-hannover.de>
> Content-Type: text/plain; charset=utf-8; format=flowed
> 
> Dear mailing list members,
> 
> 
> Based on Bill's feedback I created a template.cxx 
> (https://github.com/romangrothausmann/ITK-CLIs/blob/master/template.cxx) that I 
> just extend according to some ITK-filters when needed. In general it works well 
> for images of varying dimension and for scalar, often even for RGB and RGBA types.
> However, now I'm in the need to apply itkVectorGradientMagnitudeImageFilter to 
> images of vectors with lengths 2 to 5 for which my approach with 
> VariableLengthVector does not work.
> 
> gradient_mag_vec.cxx 
> (https://github.com/romangrothausmann/ITK-CLIs/blob/master/gradient_mag_vec.cxx)
> is based on template.cxx (diff: 
> https://github.com/romangrothausmann/ITK-CLIs/commit/544345b259adce2ef903183553a1aa97648e85b8) 
> 
> with dim= 1 and scalar removed (because not supported by 
> itkVectorGradientMagnitudeImageFilter).
> gradient_mag_vec.cxx compiles fine if complex and vector are commented out but 
> for e.g. RGB yields outputs where the last DimSize is 3* the input DimSize.
> 
> Including vector compilation aborts with complains like:
> 
> itkVectorGradientMagnitudeImageFilter.h:184:62: error: ?Dimension? is not a 
> member of ?itk::Image<itk::VariableLengthVector<double>, 3u>::PixelType {aka 
> itk::VariableLengthVector<double>}?
>    typedef typename ConstNeighborhoodIteratorType::RadiusType RadiusType;
> 
> What would I have to change to make this work for images composed of vectors 
> with e.g. 2 to 5 elements?
> Would that also solve the incorrect output for RGB/RGBA?
> Is there any elegant way to circumvent using GetNumberOfComponentsPerPixel to 
> instantiate another template level in case a vector image is detected?
> 
> Many thanks for any help or hints.
> 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-2900
> 
> 



More information about the Insight-users mailing list