12 #include "MeshFromTractsCLP.h" 14 #include "vtkPolyDataWriter.h" 29 main (
int argc,
char const* argv[])
38 reader->SetFileName(_InputFile);
41 auto fibers = reader->GetOutput();
46 MeshCreatorType::Pointer filter = MeshCreatorType::New();
48 if (_ColorScheme ==
"DIRECTION") { filter->SetColorScheme(MeshCreatorType::COLOR_BY_POINT_DIRECTION); }
49 if (_ColorScheme ==
"MEAN_DIRECTION") { filter->SetColorScheme(MeshCreatorType::COLOR_BY_MEAN_DIRECTION); }
50 if (_ColorScheme ==
"END_POINTS") { filter->SetColorScheme(MeshCreatorType::COLOR_BY_ENDPOINTS_DIRECTION); }
51 if (_ColorScheme ==
"FIXED") { filter->SetColorScheme(MeshCreatorType::COLOR_FIXED); }
52 if (_ColorScheme ==
"IMAGE") { filter->SetColorScheme(MeshCreatorType::COLOR_BY_IMAGE); }
53 if (_ColorScheme ==
"SCALARS") { filter->SetColorScheme(MeshCreatorType::COLOR_BY_SCALARS); }
54 if (_ColorScheme ==
"PROPERTY") { filter->SetColorScheme(MeshCreatorType::COLOR_BY_PROPERTY); }
56 filter->SetFiberTracts( fibers );
57 filter->SetColor(_ColorFiber[0], _ColorFiber[1], _ColorFiber[2]);
58 filter->SetFlip(_Flip[0], _Flip[1], _Flip[2]);
59 if (_TubeRadiusArg.isSet())
61 filter->SetShapeMode(MeshCreatorType::GLYPH_TUBE);
62 filter->SetTubeRadius(_TubeRadius);
65 filter->SetShapeMode(MeshCreatorType::GLYPH_LINE);
67 filter->SetDebug(_DebugArg.isSet());
69 std::cout <<
"Generating mesh ... " << std::flush;
73 std::cout << clock.GetMean() <<
"s elapsed" << std::endl;
77 vtkPolyData* mesh = filter->GetOutput();
79 if (_OutputFileArg.isSet())
SmartPointer< Self > Pointer
helper functions specifically used in dmritool
#define utlGlobalException(cond, expout)
void VisualizePolyDataWithScalarRange(const std::vector< vtkPolyData * > &meshes, const std::vector< double > &opacity, const std::vector< double > &scalarRange={-1.0,-1.0}, const std::vector< double > &hueRange={0.6667, 0.0}, const std::vector< double > &angle={0.0, 0.0}, const std::vector< int > &windowSize={600, 600}, const bool useNormal=true, const bool lighting=true, const double zoom=1.0, const std::string &pngfile="", const std::vector< double > &bgColor={0, 0, 0})
int main(int argc, char const *argv[])
Gnerate mesh from peaks.
Compute mesh from fibers.
void WriteVtkPolyData(vtkPolyData *mesh, const std::string &filename)