[Insight-users] Problems with NeighborhoodInnerProduct< MovingImageType, ComplexType, ComplexType >
Ariel Hernán Curiale
curiale at gmail.com
Fri Jul 13 04:25:50 EDT 2012
Dear All,
I have some question about the new implementation of NeighborhoodInnerProduct (ITK 4.1.0 in particular).
In this class the two function operator(...) have define the follows type:
typedef typename TImage::PixelType InputPixelType;
typedef typename NumericTraits< InputPixelType >::RealType InputPixelRealType;
typedef typename NumericTraits< InputPixelRealType >::AccumulateType AccumulateRealType;
typedef typename NumericTraits<OutputPixelType>::ValueType OutputPixelValueType;
Here I don't understand two things:
1) Why is define AccumulateRealType from the InputPixelType if the AccumulateType should come from the TOperator class ?
2) If we use for example the class NeighborhoodInnerProduct like this itk::NeighborhoodInnerProduct< MovingImageType, ComplexType, ComplexType >, we expect that the type of OutputPixelValueType was complex but instead if float.
The only way to compile the example (http://www.insight-journal.org/browse/publication/320 ) was changing:
typedef typename NumericTraits< InputPixelRealType >::AccumulateType AccumulateRealType;
typedef typename NumericTraits<OutputPixelType>::ValueType OutputPixelValueType;
for
typedef typename NumericTraits< TOperator >::AccumulateType AccumulateRealType;
typedef typename NumericTraits<OutputPixelType>::RealType OutputPixelValueType;
Any help will be greatly appreciated. Thank you.
Saludos
__________________________________
| Ariel Hernán Curiale
| ETSI Telecomunicación
| Universidad de Valladolid
| Campus Miguel Delibes
| 47011 Valladolid, Spain
| Phone: 983-423000 ext. 5590
| Web: www.curiale.com.ar
|_________________________________
El 11/07/2012, a las 17:35, Ariel Hernán Curiale escribió:
> Dear All,
>
> I'm trying to migrate the code provided into the article "Image registration using the Morphon algorithm: an ITK implementation" (http://www.insight-journal.org/browse/publication/320 ) from ITK 3.6 to 4.1 but I have some troubles with the class NeighborhoodInnerProduct< TImage, TOperator, TComputation >
>
> Where can I find an example using different TOperator and TComputation ?
>
>
> For example I'm trying to do this:
>
> typedef itk::Image < float, Dimension > MovingImageType;
> typedef std::complex<double> ComplexType;
> typedef itk::Image< ComplexType, ImageDimension > ComplexMatrixType;
> typedef itk::ConstNeighborhoodIterator< MovingImageType > NeighborhoodIteratorType;
> typedef itk::ImageRegionIterator<ComplexMatrixType> ComplexNeighborhoodOperatorType;
> typedef typename FilterType::ComplexOperator ComplexOpType;
>
> itk::NeighborhoodInnerProduct< MovingImageType, ComplexType, ComplexType > innerProduct;
> ComplexNeighborhoodOperatorType out;
>
> /* Quadrature Filters */
> ComplexOpType* Complexfilter = m_Filters->GetComplexOp(choice) ;
> NeighborhoodIteratorType InIT = NeighborhoodIteratorType( (*Complexfilter).GetRadius() , InImage, InImage->GetRequestedRegion() );
>
> std::complex<double> temp;
> out = ComplexNeighborhoodOperatorType( OutImage, OutImage->GetRequestedRegion() );
>
> for(InIT.GoToBegin(), out.GoToBegin(); !InIT.IsAtEnd(); ++InIT, ++out )
> {
> temp = innerProduct ( InIT, (*Complexfilter) ) ;
> out.Set( conj(temp) );
> }//end for
>
>
>
>
> And get the following error:
>
> InsightToolkit-4.1.0/Modules/Core/Common/include/itkNeighborhoodInnerProduct.hxx:52:7: error: cannot convert 'const std::complex<double>' to 'OutputPixelValueType' (aka 'double') without a conversion operator
> static_cast< OutputPixelValueType >( *o_it ) *
>
>
> There is something wrong in the code ?
> This code compile perfectly in ITK-3.20.1
>
>
> Any help will be greatly appreciated. Thank you
> __________________________________
> | Ariel Hernán Curiale
> | ETSI Telecomunicación
> | Universidad de Valladolid
> | Campus Miguel Delibes
> | 47011 Valladolid, Spain
> | Phone: 983-423000 ext. 5590
> | Web: www.curiale.com.ar
> |_________________________________
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120713/cc81b94e/attachment-0001.htm>
More information about the Insight-users
mailing list