+ {
+ typedef itk::Image< unsigned char, Dimension > ImageMaskType;
+ typedef itk::ImageFileReader< ImageMaskType > MaskReaderType;
+ MaskReaderType::Pointer maskReader = MaskReaderType::New();
+ maskReader->SetFileName(m_ArgsInfo.mask_arg);
+
+ try
+ {
+ maskReader->Update();
+ }
+ catch ( itk::ExceptionObject & err )
+ {
+ std::cerr << "ExceptionObject caught while reading mask !" << std::endl;
+ std::cerr << err << std::endl;
+ return;
+ }
+ if (m_Verbose)std::cout <<"Mask was read..." <<std::endl;
+
+ // Set the image to the spatialObject
+ spatialObjectMask = MaskType::New();
+ spatialObjectMask->SetImage( maskReader->GetOutput() );
+ blut_transform->SetMask(spatialObjectMask);
+ }
+
+ if (m_ArgsInfo.type_arg != 0 ) { // using BLUT
+ // Spline orders: Default is cubic splines
+ if (m_Verbose) {
+ std::cout << "Using clitk::BLUT." << std::endl;
+ std::cout << "Setting spline orders and sampling factors." << std::endl;
+ }
+ InputImageType::RegionType::SizeType splineOrders ;
+ splineOrders.Fill(3);
+ if (m_ArgsInfo.order_given)
+ for (unsigned int i=0; i<Dimension;i++)
+ splineOrders[i]=m_ArgsInfo.order_arg[i];
+ if (m_Verbose) std::cout<<"Setting the spline orders to "<<splineOrders<<"..."<<std::endl;
+
+ // Samplingfactors
+ InputImageType::SizeType samplingFactors;
+ for (unsigned int i=0; i< Dimension; i++)