<html><head><style type="text/css">body { background: rgba(255, 255, 255, 255); }</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Thanks all for your quickly response.<div><br></div><div>I use gcc-4.2 (llvm-gcc-4.2) and the code is this:</div><div><br></div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">const unsigned int Dimension = 2;</font></div></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3">/*The files' names*/</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"> std::string imageFixedName = argv[1];</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"> std::string imageMovingName = argv[2];</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"> std::string imageOutputName = argv[3];</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><br></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"> size_t ext_pos = imageOutputName.find_last_of( '.' );</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"> std::string ext( imageOutputName, ext_pos );</font></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"> <br class="webkit-block-placeholder"></font></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><br></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><br></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><br></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span>typedef unsigned char OutputPixelType;</font></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span> <br class="webkit-block-placeholder"></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span><br class="webkit-block-placeholder"></font></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span>typedef double PixelType;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span>typedef float InternalPixelType;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span>typedef itk::Image < InternalPixelType, Dimension > InternalImageType;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>InternalImageType::Pointer CertaintyImage;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>InternalImageType::Pointer InternalMovingImage;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span>typedef itk::Vector< float, Dimension > VectorPixelType;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span>typedef itk::Image < VectorPixelType, Dimension > DeformationFieldType;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span>typedef itk::Image< OutputPixelType, <span style="text-decoration: underline; ">Dimension</span> > OutputImageType; </font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span>typedef itk::Image < PixelType, Dimension > FixedImageType;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span>typedef itk::Image < PixelType, Dimension > MovingImageType;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span>typedef itk::ImageFileReader < FixedImageType > FixedImageReaderType;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>FixedImageReaderType::Pointer fixedImageReader = FixedImageReaderType::New();</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>fixedImageReader->SetFileName( imageFixedName );</font></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></font></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>try{</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>fixedImageReader->Update();</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>}</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span> catch( itk::ExceptionObject & err )</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>{</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>std::cout << "ExceptionObject caught !" << std::endl;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>std::cout << err << std::endl;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>return -1;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>}</font></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></font></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>FixedImageType::Pointer fixedImage = fixedImageReader->GetOutput();</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span>typedef itk::ImageFileReader < MovingImageType > MovingImageReaderType;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>MovingImageReaderType::Pointer movingImageReader = MovingImageReaderType::New();</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>movingImageReader->SetFileName( imageMovingName );</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>try</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>{</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>movingImageReader->Update();</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>}</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span> catch( itk::ExceptionObject & err )</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>{</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>std::cout << "ExceptionObject caught !" << std::endl;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>std::cout << err << std::endl;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>return -1;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>}</font></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></font></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>MovingImageType::Pointer movingImage = movingImageReader->GetOutput();</font></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></font></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>std::cout<< movingImage<<std::endl;</font></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></font></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span>typedef itk::CastImageFilter < MovingImageType, InternalImageType > MovingCasterType;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>MovingCasterType::Pointer movingImageCaster = MovingCasterType::New();</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>movingImageCaster->SetInput( movingImageReader->GetOutput() );</font></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></font></p><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></font></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>std::cout<<"0"<<std::endl;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>try</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>{</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>movingImageCaster->Update();</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>}</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                </span> catch( itk::ExceptionObject & err )</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>{</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>std::cout << "ExceptionObject caught !" << std::endl;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>std::cout << err << std::endl;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>return -1;</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">                        </span>}</font></div><p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; min-height: 15px; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space:pre">        </span><br class="webkit-block-placeholder"></font></p><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Monaco; "><font class="Apple-style-span" face="Helvetica" size="3"><span class="Apple-tab-span" style="white-space: pre; ">                </span> std::cout<<"1"<<std::endl;</font></div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>The movingImageReader->GetOutput() is</div><div><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div><blockquote type="cite"><div>Image (0x7fc201cda600)<br> RTTI typeinfo: itk::Image<double, 2u><br> Reference Count: 3<br> Modified Time: 307<br> Debug: Off<br> Observers: <br> none<br> Source: (0x7fc201cde1f0) <br> Source output index: 0<br> Release Data: Off<br> Data Released: False<br> Global Release Data: Off<br> PipelineMTime: 179<br> UpdateMTime: 308<br> LargestPossibleRegion: <br> Dimension: 2<br> Index: [0, 0]<br> Size: [800, 600]<br> BufferedRegion: <br> Dimension: 2<br> Index: [0, 0]<br> Size: [800, 600]<br> RequestedRegion: <br> Dimension: 2<br> Index: [0, 0]<br> Size: [800, 600]<br> Spacing: [1, 1]<br> Origin: [0, 0]<br> Direction: <br>1 0<br>0 1<br><br> IndexToPointMatrix: <br> 1 0<br>0 1<br><br> PointToIndexMatrix: <br> 1 0<br>0 1<br><br> PixelContainer: <br> ImportImageContainer (0x7fc201cde360)<br> RTTI typeinfo: itk::ImportImageContainer<unsigned long, double><br> Reference Count: 1<br> Modified Time: 306<br> Debug: Off<br> Observers: <br> none<br> Pointer: 0x108d15000<br> Container manages memory: true<br> Size: 480000<br> Capacity: 480000</div></blockquote></div></div></div></blockquote></div><div><br><div apple-content-edited="true">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; "><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">Thanks,</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">__________________________________<br><font class="Apple-style-span" color="#b7bfc5">|</font> Ariel Hernán Curiale<br><font class="Apple-style-span" color="#b7bfc5">|</font> ETSI Telecomunicación<br><font class="Apple-style-span" color="#b7bfc5">|</font> Universidad de Valladolid<br><font class="Apple-style-span" color="#b7bfc5">|</font> Campus Miguel Delibes<br><font class="Apple-style-span" color="#b7bfc5">|</font> 47011 Valladolid, Spain<br><font class="Apple-style-span" color="#b7bfc5">|</font> Phone: 983-423000 ext. 5590</div><div><font class="Apple-style-span" color="#b7b7b7" style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">|</font> Web: <a href="http://www.curiale.com.ar/"><font class="Apple-style-span" color="#084ebe">www.curiale.com.ar</font></a><br><font class="Apple-style-span" color="#b7b7b7" style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; ">|</font><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; font-weight: normal; font-style: normal; color: rgb(0, 0, 0); ">_________________________________</span></div></div></div></div></span></div></span></div></span></div></span></div></span></div></span></div></div>
</div>
<br><div><div>El 10/07/2012, a las 20:27, Bradley Lowekamp escribió:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">What compiler are you using? Have you tried gcc-4.2 instead of clang? I don't think that 3.20 would have been tested and build with the new clang.<div><br></div><div>Brad</div><div><br><div><div>On Jul 10, 2012, at 12:43 PM, ariel wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hi,<br><br>I've had some troubles after xcode update (from 4.1 to 4.3.3).<br><br>When I compiled ITK-3.20.1 I had too many warnings like this: <br>InsightToolkit-3.20.1/Utilities/vxl/core/vnl/vnl_math.h:86:36: warning:<br>in-class initializer for static data member of type 'const double' is a GNU<br>extension [-Wgnu] static VNL_DLL_DATA const double e<br>VCL_STATIC_CONST_INIT_FLOAT_DECL(2.7182818284590452354);<br><br><br><br>Second, I made a simple program and I can't explain why this code exit with<br>segmentation fault:<br><br>typedef itk::CastImageFilter < MovingImageType, InternalImageType > <br>MovingCasterType;<br> MovingCasterType::Pointer movingImageCaster =<br>MovingCasterType::New();<br> movingImageCaster->SetInput( movingImageReader->GetOutput() );<br><br><br> std::cout<<"0"<<std::endl;<br> try<br> {<br> movingImageCaster->Update();<br> }<br><span class="Apple-tab-span" style="white-space:pre">        </span> catch( itk::ExceptionObject & err )<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>{<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>std::cout << "ExceptionObject caught !" << std::endl;<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>std::cout << err << std::endl;<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>return -1;<br><span class="Apple-tab-span" style="white-space:pre">        </span><span class="Apple-tab-span" style="white-space:pre">        </span>}<br><br><br><br>The input of the caster filter is:<br><br>Image (0x7fc201cda600)<br> RTTI typeinfo: itk::Image<double, 2u><br> Reference Count: 3<br> Modified Time: 307<br> Debug: Off<br> Observers: <br> none<br> Source: (0x7fc201cde1f0) <br> Source output index: 0<br> Release Data: Off<br> Data Released: False<br> Global Release Data: Off<br> PipelineMTime: 179<br> UpdateMTime: 308<br> LargestPossibleRegion: <br> Dimension: 2<br> Index: [0, 0]<br> Size: [800, 600]<br> BufferedRegion: <br> Dimension: 2<br> Index: [0, 0]<br> Size: [800, 600]<br> RequestedRegion: <br> Dimension: 2<br> Index: [0, 0]<br> Size: [800, 600]<br> Spacing: [1, 1]<br> Origin: [0, 0]<br> Direction: <br>1 0<br>0 1<br><br> IndexToPointMatrix: <br> 1 0<br>0 1<br><br> PointToIndexMatrix: <br> 1 0<br>0 1<br><br> PixelContainer: <br> ImportImageContainer (0x7fc201cde360)<br> RTTI typeinfo: itk::ImportImageContainer<unsigned long, double><br> Reference Count: 1<br> Modified Time: 306<br> Debug: Off<br> Observers: <br> none<br> Pointer: 0x108d15000<br> Container manages memory: true<br> Size: 480000<br> Capacity: 480000<br><br><br>Thanks,<br>Ariel.<br><br>--<br>View this message in context: <a href="http://itk-insight-users.2283740.n2.nabble.com/CastImageFilter-Error-tp7580458.html">http://itk-insight-users.2283740.n2.nabble.com/CastImageFilter-Error-tp7580458.html</a><br>Sent from the ITK Insight Users mailing list archive at <a href="http://Nabble.com/">Nabble.com</a>.<br>_____________________________________<br>Powered by <a href="http://www.kitware.com/">www.kitware.com</a><br><br>Visit other Kitware open-source projects at<br><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br><br>Kitware offers ITK Training Courses, for more information visit:<br><a href="http://www.kitware.com/products/protraining.php">http://www.kitware.com/products/protraining.php</a><br><br>Please keep messages on-topic and check the ITK FAQ at:<br>http://www.itk.org/Wiki/ITK_FAQ<br><br>Follow this link to subscribe/unsubscribe:<br>http://www.itk.org/mailman/listinfo/insight-users<br></div></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">========================================================</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Bradley Lowekamp<span class="Apple-converted-space"> </span><span class="Apple-converted-space"> </span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Medical Science and Computing for</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">Office of High Performance Computing and Communications</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; ">National Library of Medicine<span class="Apple-converted-space"> </span></font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><font face="Helvetica" size="3" style="font: normal normal normal 12px/normal Helvetica; "><a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a></font></div><br class="Apple-interchange-newline"></span></div></span></span><br class="Apple-interchange-newline">
</div>
<br></div></div></blockquote></div><br></div></body></html>