[Insight-users] Need help with LandmarkInitializer
Eve
evelyn_heyes at homeworking.org
Sat Apr 28 00:07:22 EDT 2007
Hi ITK users,
I would like to use the LandMarkInitializer. Could someone please suggest
the proper arguments for SetFixedLandmarks() and SetMovingLandmarks()? i.e.
this is what I have:
landmarkInitializer->SetFixedLandmarks( fixedPointSet->GetPointData() );
landmarkInitializer->SetMovingLandmarks( movingPointSet->GetPointData() );
But I would get this compiler error:
'itk::LandmarkBasedTransformInitializer<TTransform,TFixedImage,TMovingImage>::SetMovingLandmarks'
: cannot convert parameter 1 from
'itk::VectorContainer<TElementIdentifier,TElement> *' to 'std::vector<_Ty>
&'
Thanks so much,
Evelyn
===========================================
Here are the typedefs:
typedef itk::PointSet< float, Dimension > PointSetType;
typedef PointSetType::PointType PointType;
typedef PointSetType::PointsContainer PointsContainer;
PointSetType::Pointer fixedPointSet = PointSetType::New();
PointSetType::Pointer movingPointSet = PointSetType::New();
PointsContainer::Pointer fixedPointContainer = PointsContainer::New();
PointsContainer::Pointer movingPointContainer = PointsContainer::New();
PointType fixedPoint;
PointType movingPoint;
// Read the file containing coordinates of fixed points.
std::ifstream fixedFile, movingFile;
if( fixedFile.fail() )
{
std::cerr << "Error opening points file with name : " << std::endl;
std::cerr << argv[1] << std::endl;
return 2;
}
unsigned int pointId = 0;
fixedFile >> fixedPoint;
while( !fixedFile.eof() )
{
fixedPointContainer->InsertElement( pointId, fixedPoint );
fixedFile >> fixedPoint;
pointId++;
}
fixedPointSet->SetPoints( fixedPointContainer );
std::cout << "Number of fixed Points = " <<
fixedPointSet->GetNumberOfPoints() << std::endl;
if( movingFile.fail() )
{
std::cerr << "Error opening points file with name : " << std::endl;
std::cerr << argv[2] << std::endl;
return 2;
}
pointId = 0;
movingFile >> movingPoint;
while( !movingFile.eof() )
{
movingPointContainer->InsertElement( pointId, movingPoint );
movingFile >> movingPoint;
pointId++;
}
movingPointSet->SetPoints( movingPointContainer );
std::cout << "Number of moving Points = " <<
movingPointSet->GetNumberOfPoints() << std::endl;
typedef itk::VersorRigid3DTransform< double > VersorTransformType;
VersorTransformType::Pointer vTransform =VersorTransformType::New();
typedef itk::LandmarkBasedTransformInitializer< VersorTransformType,
ImageType, ImageType > LandmarkInitializerType;
LandmarkInitializerType::Pointer landmarkInitializer =
LandmarkInitializerType::New();
landmarkInitializer->SetFixedImage( fixedReader->GetOutput() );
landmarkInitializer->SetMovingImage( movingReader->GetOutput() );
landmarkInitializer->SetFixedLandmarks( fixedPointSet->GetPointData() );
landmarkInitializer->SetMovingLandmarks( movingPointSet->GetPointData() );
--
View this message in context: http://www.nabble.com/Need-help-with-LandmarkInitializer-tf3660941.html#a10229626
Sent from the ITK - Users mailing list archive at Nabble.com.
More information about the Insight-users
mailing list