[Insight-users] errors when implementing itkCannyEdgeDetectionImageFilter
Bill Lorensen
bill.lorensen at gmail.com
Mon Apr 9 23:48:44 EDT 2012
The input and output images must be of floating type. From the
comments in the class:
* The input to this filter should be a scalar, real-valued Itk image of
* arbitrary dimension. The output should also be a scalar, real-value Itk
* image of the same dimensionality.
On Mon, Apr 9, 2012 at 5:37 PM, <danieljohnsonusa at netscape.net> wrote:
> I tried to build a simple program to implement the
> itkCannyEdgeDetectionImageFilter, but I got an error that I am having a hard
> time understanding. I got the error
>
> 1>c:\slicer4-sbuild-new\itkv3\code\common\itkConceptChecking.h(723) : error
> C2440: 'initializing' : cannot convert from
> 'itk::Concept::Detail::UniqueType_bool<__formal>' to
> 'itk::Concept::Detail::UniqueType_bool<__formal>'
> 1> with
> 1> [
> 1> __formal=false
> 1> ]
> 1> and
> 1> [
> 1> __formal=true
> 1> ]
> 1> No user-defined-conversion operator available that can perform
> this conversion, or the operator cannot be called
> 1> c:\slicer4-sbuild-new\itkv3\code\common\itkConceptChecking.h(722)
> : while compiling class template member function 'void
> itk::Concept::IsFloatingPoint<T>::Constraints::constraints(void)'
> 1> with
> 1> [
> 1> T=short
> 1> ]
>
> It seems like the input variable data type that I'm sending as an input
> don't match the datatypes that the filter class is expecting. What
> datatypes does the filter expect. My program inputs are the lower
> threshold, upper threshold, and variance, all formatted as double. Is there
> an input I'm missing, or is the datatype supposed to be other than double?
> I'm posting the code I used below (very short). Can anyone help identify
> which variables I have formatted incorrectly?
>
> Thanks,
>
> Daniel
>
>
> typedef itk::Image<short,3> ImageType;
>
> typedef itk::ImageFileReader<ImageType> ReaderType;
> typedef itk::ImageFileWriter<ImageType> WriterType;
>
> ReaderType::Pointer reader = ReaderType::New();
> WriterType::Pointer writer = WriterType::New();
> reader->SetFileName(inputVolume.c_str() );
> writer->SetFileName (outputVolume.c_str());
> typedef itk::CannyEdgeDetectionImageFilter <ImageType, ImageType>
> FilterType;
> FilterType::Pointer filter = FilterType::New();
> try {
> filter->SetInput(reader->GetOutput());
> filter->SetVariance(variance);
> filter->SetLowerThreshold(lthreshold);
> filter->SetUpperThreshold(uthreshold);
> writer->SetInput(filter->GetOutput());
> writer->Update();
> }
>
>
>
> _____________________________________
> 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://www.itk.org/mailman/listinfo/insight-users
--
Unpaid intern in BillsBasement at noware dot com
More information about the Insight-users
mailing list