[Insight-users] Problems with NeighborhoodInnerProduct< MovingImageType, ComplexType, ComplexType >

Ariel Hernán Curiale curiale at gmail.com
Wed Jul 11 11:35:34 EDT 2012


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/20120711/e0016e93/attachment.htm>


More information about the Insight-users mailing list