/** * Write a floating point 2D image containing the Voltage-Sensitive Dye * projection, using a Beer-Lambert projection filter. The projection filter * computes the output using the real value of the data, i.e. not limited by * the precision of the final image * * @param input 3d volume used as input to generate the 2D projection * @param filename name of the output image file */ void projectVSD( VolumePtr input, const std::string& filename ) { typedef BeerLambertProjectionImageFilter < fivox::FloatVolume, FloatImageType > FilterType; FilterType::Pointer projection = FilterType::New(); projection->SetInput( input ); projection->SetProjectionDimension( 1 ); // projection along Y-axis projection->SetPixelSize( input->GetSpacing( ).GetElement( 0 )); const double sigma = _vm["sigma"].as< double >(); projection->SetSigma( sigma ); // Write output image typedef itk::ImageFileWriter< FloatImageType > ImageWriter; ImageWriter::Pointer imageWriter = ImageWriter::New(); imageWriter->SetInput( projection->GetOutput( )); const std::string& imageFile = filename + ".vtk"; imageWriter->SetFileName( imageFile ); imageWriter->Update(); LBINFO << "VSD projection written as '" << imageFile << "' using a sigma value of " << sigma << std::endl; }