- /* TODO
- int i = 1;
- TImage::PointType ori = input_image->GetOrigin( );
- std::cout << ori << std::endl;
- for( TBranches::const_iterator bIt = branches.begin( ); bIt != branches.end( ); ++bIt, ++i )
- {
- TImage::PointType::VectorType v1 = bIt->V1 - ori;
- TImage::PointType::VectorType v2 = bIt->V2 - ori;
- std::cout
- << std::setiosflags( std::ios::fixed) << std::setprecision( 3 )
- << i << "\t1.000\t"
- << bIt->Length << "\t"
- << v1[ 0 ] << "\t"
- << v1[ 1 ] << "\t"
- << v1[ 2 ] << "\t"
- << v2[ 0 ] << "\t"
- << v2[ 1 ] << "\t"
- << v2[ 2 ] << "\t"
- << ( v2 - v1 ).GetNorm( )
- << std::endl;
-
- } // rof
- */
+ std::ofstream bout( output_imagej_fn.c_str( ) );
+ if( !bout )
+ {
+ std::cerr << "Error: could not open " << output_imagej_fn << std::endl;
+ return( 1 );
+
+ } // fi
+ int i = 1;
+ for( TBranches::const_iterator bIt = branches.begin( ); bIt != branches.end( ); ++bIt, ++i )
+ {
+ bout
+ << std::setiosflags( std::ios::fixed) << std::setprecision( 3 )
+ << i << "\t1.000\t"
+ << bIt->Length << "\t"
+ << bIt->V1[ 0 ] << "\t"
+ << bIt->V1[ 1 ] << "\t"
+ << bIt->V1[ 2 ] << "\t"
+ << bIt->V2[ 0 ] << "\t"
+ << bIt->V2[ 1 ] << "\t"
+ << bIt->V2[ 2 ] << "\t"
+ << ( bIt->V2 - bIt->V1 ).GetNorm( )
+ << std::endl;
+
+ } // rof
+ bout.close( );