option "spacing" - "New output spacing if different from input" double no multiple
option "spacinglike" - "New output spacing like this image" string no
option "origin" - "New output origin if different from input" double no multiple
+option "direction" - "New output direction if different from input" double no multiple
option "matrix" m "Affine matrix (homogene) filename" string no
option "elastix" e "Read EulerTransform from elastix output file (combine if multiple)" string no
option "rotate" r "Rotation to apply (radians)" double no multiple
option "interpVF" - "Interpolation: 0=NN, 1=Linear, 2=BSpline, 3=BLUT" int no default="1"
option "interpVFOrder" - "Order if BLUT or BSpline (0-5)" int no default="3"
option "interpVFSF" - "Sampling factor if BLUT" int no default="20"
-
-
-
-
outputOrigin[i]=m_ArgsInfo.origin_arg[i];
} else outputOrigin=input->GetOrigin();
+ //Direction
+ typename OutputImageType::DirectionType outputDirection;
+ if (m_ArgsInfo.direction_given) {
+ for(unsigned int j=0; j< Dimension; j++)
+ for(unsigned int i=0; i< Dimension; i++)
+ outputDirection[j][i]=m_ArgsInfo.direction_arg[i+Dimension*j];
+ } else outputDirection=input->GetDirection();
+
// Set
resampler->SetSize( outputSize );
resampler->SetOutputSpacing( outputSpacing );
resampler->SetOutputOrigin( outputOrigin );
+ resampler->SetOutputDirection( outputDirection );
}
std::cout << "Setting the output size to " << resampler->GetSize() << "..." << std::endl;
std::cout << "Setting the output spacing to " << resampler->GetOutputSpacing() << "..." << std::endl;
std::cout << "Setting the output origin to " << resampler->GetOutputOrigin() << "..." << std::endl;
+ std::cout << "Setting the output direction to " << resampler->GetOutputDirection() << "..." << std::endl;
}
resampler->SetInput( input );
resampler->SetSize( likeReader->GetOutput()->GetLargestPossibleRegion().GetSize() );
resampler->SetOutputSpacing( likeReader->GetOutput()->GetSpacing() );
resampler->SetOutputOrigin( likeReader->GetOutput()->GetOrigin() );
+ resampler->SetOutputDirection( likeReader->GetOutput()->GetDirection() );
} else {
//Size
typename OutputImageType::SizeType outputSize;
} else outputOrigin=input->GetOrigin();
std::cout<<"Setting the origin to "<<outputOrigin<<"..."<<std::endl;
+ //Direction
+ typename OutputImageType::DirectionType outputDirection;
+ if (m_ArgsInfo.direction_given) {
+ for(unsigned int j=0; j< Dimension; j++)
+ for(unsigned int i=0; i< Dimension; i++)
+ outputDirection[j][i]=m_ArgsInfo.direction_arg[i+Dimension*j];
+ } else outputDirection=input->GetDirection();
+ std::cout<<"Setting the direction to "<<outputDirection<<"..."<<std::endl;
+
// Set
resampler->SetSize( outputSize );
resampler->SetOutputSpacing( outputSpacing );
resampler->SetOutputOrigin( outputOrigin );
+ resampler->SetOutputDirection( outputDirection );
}