Welcome Guest ( Log In | Click here to Register a free account now! )
Welcome to Bleeping Computer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.
Aug 20 2009, 11:05 AM
Post
#1
|
|
|
New Member ![]() Group: Members Posts: 9 Joined: 5-August 09 Member No.: 360,795 |
#if defined(_MSC_VER) #pragma warning ( disable : 4786 ) #endif #ifdef __BORLANDC__ #define ITK_LEAN_AND_MEAN #endif #include "itkHessian3DToVesselnessMeasureImageFilter.h" #include "itkHessianRecursiveGaussianImageFilter.h" #include "itkSymmetricSecondRankTensor.h" #include "itkImage.h" #include "itkImageFileReader.h" #include "itkImageFileWriter.h" int main( int argc, char *argv[] ) { if( argc < 3 ) { std::cerr << "Usage: inputImage outputImage [sigma] [alpha_1] [alpha_2]" << std::endl;return EXIT_FAILURE; } const unsigned int Dimension = 3; typedef double InputPixelType; typedef float OutputPixelType; typedef itk::Image< InputPixelType, Dimension > InputImageType; typedef itk::Image< OutputPixelType, Dimension > OutputImageType; typedef itk::HessianRecursiveGaussianImageFilter< InputImageType > HessianFilterType; typedef itk::Hessian3DToVesselnessMeasureImageFilter< OutputPixelType > VesselnessMeasureFilterType; typedef itk::ImageFileReader< InputImageType > ReaderType; typedef itk::ImageFileWriter< OutputImageType > WriterType; HessianFilterType::Pointer hessianFilter = HessianFilterType::New(); VesselnessMeasureFilterType::Pointer vesselnessFilter = VesselnessMeasureFilterType::New(); ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); reader->SetFileName( argv[1] ); hessianFilter->SetInput( reader->GetOutput() ); if( argc >= 4 ) { hessianFilter->SetSigma( static_cast< double >(atof(argv[3])) ); } vesselnessFilter->SetInput( hessianFilter->GetOutput() ); writer->SetInput( vesselnessFilter->GetOutput() ); writer->SetFileName( argv[2] ); if( argc >= 5 ) { vesselnessFilter->SetAlpha1( static_cast< double >(atof(argv[4]))); } if( argc >= 6 ) { vesselnessFilter->SetAlpha2( static_cast< double >(atof(argv[5]))); } writer->Update(); return EXIT_SUCCESS; } Thanks again |
|
|
|
![]() |
Aug 20 2009, 11:17 AM
Post
#2
|
|
![]() Look buddy -- I'm an Engineer ![]() ![]() ![]() ![]() ![]() ![]() Group: HJT Team Coach Posts: 8,510 Joined: 17-January 08 From: Northfield, Ohio Member No.: 184,215 |
1. That code depends on external libraries we do not have. If you ask questions about libraries, you have to include them.
2. We do not do homework. You need to start with a simpler example anyway before jumping into a rats nest of code..... Billy3 -------------------- The forum is always a busy place. In the event I fail to reply within twenty-four hours, feel free to send me a PM.
Have I helped you? If so, please consider a donation (by clicking this link). And that means I solve problems. Not problems like "What is beauty?" .. 'cause that would fall under the purview of your conundrums of philosophy.... |
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 21st November 2009 - 09:26 PM |