[ITK-users] reading images of vectors with variable length in addition to scalar, RGB, RGBA (itkVectorGradientMagnitudeImageFilter)
Grothausmann, Roman Dr.
grothausmann.roman at mh-hannover.de
Tue May 10 05:17:37 EDT 2016
Hi Kris,
Many thanks for Your quick reply. Looking at
itkPatchBasedDenoisingImageFilter.hxx and according to
itkPatchBasedDenoisingImageFilterTest.cxx
I exchanged itkImage of VariableLengthVector with itkVectorImage
(https://github.com/romangrothausmann/ITK-CLIs/commit/87281e2bad89e1d1d3303ac6605b3c43963026d3)
but the error stays the same.
I think my problem arises from VectorGradientMagnitudeImageFilter not being able
to cope with VariableLengthVector which is also used by VectorImage. So I guess
I would either have to modify VectorGradientMagnitudeImageFilter to handle
VariableLengthVector or create itkImage of Vector using another template level
to set fixed NumberOfComponentsPerPixel as needed.
What does it depend on whether a Filter can handle VariableLengthVector or just
Vector?
Many thanks for Your help.
Roman
On 09/05/16 22:18, Kristen Zygmunt wrote:
> 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
>>
>>
>
--
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