int main(
int argc,
char* argv[])
{
if (argc < 4)
{
std::cout << argv[0] << " <input vector filename> <input image name> <output vector filename> " << std::endl;
return EXIT_FAILURE;
}
VectorDataFileReaderType::Pointer reader = VectorDataFileReaderType::New();
reader->SetFileName(argv[1]);
reader->UpdateOutputInformation();
ImageReaderType::Pointer imageReader = ImageReaderType::New();
imageReader->SetFileName(argv[2]);
imageReader->UpdateOutputInformation();
VectorDataFilterType::Pointer vectorDataProjection = VectorDataFilterType::New();
vectorDataProjection->SetInput(reader->GetOutput());
vectorDataProjection->SetOutputImageMetadata(&imageReader->GetOutput()->GetImageMetadata());
vectorDataProjection->SetOutputOrigin(imageReader->GetOutput()->GetOrigin());
vectorDataProjection->SetOutputSpacing(imageReader->GetOutput()->GetSignedSpacing());
vectorDataProjection->SetOutputProjectionRef(imageReader->GetOutput()->GetProjectionRef());
VectorDataFileWriterType::Pointer writer = VectorDataFileWriterType::New();
writer->SetFileName(argv[3]);
writer->SetInput(vectorDataProjection->GetOutput());
writer->Update();
return EXIT_SUCCESS;
}
int main(int ac, char *av[])