[ITK] [ITK-users] [ITK-Users] Multiple Inputs of different types
Michael Pinkert
mpinkert at wisc.edu
Wed Jan 21 15:29:15 EST 2015
Hi Matt,
Following the example of those filters seems to have worked, I'm no longer getting errors related to the multiple inputs. Thank you very much.
Best regards,
Michael Pinkert
________________________________________
From: Matt McCormick <matt.mccormick at kitware.com>
Sent: Wednesday, January 21, 2015 2:11 PM
To: Michael Pinkert
Cc: insight-users at itk.org
Subject: Re: [ITK-users] [ITK-Users] Multiple Inputs of different types
Hi Michael,
The ImageToImageFilter will still need to be templated over
TInputImage and TOutputImage.
For example filters that have multiple inputs to study, see, e.g.,
ConvolutionImageFilterBase [1] (has a KernalImage input)
MaskedFFTNormalizedCorrelationImageFilter [2] (has MaskImage input)
HistogramThresholdImageFilter [3] (has MaskImage input)
HTH,
Matt
[1] http://itk.org/Doxygen/html/classitk_1_1ConvolutionImageFilterBase.html
[2] http://itk.org/Doxygen/html/classitk_1_1MaskedFFTNormalizedCorrelationImageFilter.html#a238b7f7d871a81849e66a12e0564825a
[3] http://itk.org/Doxygen/html/classitk_1_1HistogramThresholdImageFilter.html#a19a692e8043422ba6721815f94f04944
On Wed, Jan 21, 2015 at 2:44 PM, Michael Pinkert <mpinkert at wisc.edu> wrote:
> Hi all,
>
> I'm trying to develop a Vector Connected Component Filter/pipeline that
> checks the direction of the eigenvector as well as whether or not the pixels
> are touching. I am doing this by modifying the three following filters that
> build off of each other.
>
> itkSymmetricEigenAnalysisImageFilter.h so that it returns the largest
> eigenvector rather than the eigenvalues
>
> itkBinaryImageToLabelMapFilter.h to check that the eigenvectors for each
> pixel are aligned after checking that they are touching
>
> itkBinaryShapeKeepNObjectsImageFilter.h to simply pass the hessian into the
> LabelMapFilter.
>
> The problem is that I need to include a image that contains the hessian for
> each pixel along with the normal input image, so that the KeepNObjects
> filter can send it down to the LabelMapFilter and then to the
> EigenAnalysisFilter. However, none of the methods I have tried to get the
> hessian image into the filters work, and I do not understand how to allow
> for this second input.
>
> So far I have tried modifying the template as follows
>
> class BinaryVectorConnectedShapeKeepNObjectsImageFilter:
> public ImageToImageFilter< TInputImage, THessianImage, TInputImage >
>
> Combined with using the SetInputX functions as seen in other filters as
> follows
>
> void SetInput1(const TInputImage *image1)
> {
> this->SetNthInput(0, const_cast <TInputImage * >( image1));
> }
>
> This produces an error of "Too many template arguments".
>
> I have tried to make the hessian image a member variable and to use the
> normal Get/Set macros, but that also produces errors of being unable to
> convert between types when the function is used in main.
>
> I have also tried to simply define a new function to set the Hessian, like
> such
>
> void SetHessian(HessianImageType::Pointer hessianImage)
> {
> m_HessianImage = hessianImage;
> }
>
> And alternate versions with different input arguments, which include "const
> HessianImage *hessianImage". These also run into errors where it won't
> covert between types when I use the function in main.
>
> I have looked around at different filters that have multiple inputs, and all
> of them seem to be based on Functors/the BinaryFunctorImageFilter, but I am
> very unsure of how I would go about modifying the filters, and have very
> little experience with Functors. Also, the arguments for the other filters
> based on Functors all seem to include an operator as a fourth argument, and
> I do not want to perform any operations on the Hessian until the
> SymmetricAnalysis filter.
>
> Does anyone know how I could set this second input simply, or could point me
> to an example that does similar?
>
> Best regards,
> Michael Pinkert
>
>
>
>
>
>
> --
> View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-Users-Multiple-Inputs-of-different-types-tp7586810.html
> Sent from the ITK Insight Users mailing list archive at Nabble.com.
> _____________________________________
> 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
_____________________________________
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