BleepingComputer.com: want to understand

Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, 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.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

want to understand

#1 User is offline   sassou 

  • New Member
  • Pip
  • Find Topics
  • Group: Members
  • Posts: 9
  • Joined: 05-August 09

Posted 20 August 2009 - 11:05 AM

I need that someone help me and comment the following code to me exactly. even i learned many tutorials of c++ but i still need help because it's so complicated to me. all i want that some one explain to me with comments every step.thanks for your help
#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

#2 User is offline   Billy O'Neal 

  • Bleepin Engineer
  • PipPipPipPipPipPip
  • Find Topics
  • Group: Malware Response Instructor
  • Posts: 10,079
  • Joined: 17-January 08
  • Gender:Male
  • Location:Cleveland, Ohio

Posted 20 August 2009 - 11:17 AM

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users