18 #include <vtkSmartPointer.h>
19 #include <vtkCleanPolyData.h>
20 #include <itksys/SystemTools.hxx>
23 #include <vtkFloatArray.h>
24 #include <vtkCellData.h>
25 #include <vtkPointData.h>
54 std::ofstream outStream;
56 if( this->GetOutputStream() )
58 out = this->GetOutputStream();
60 outStream.open( this->GetOutputLocation().c_str() );
71 const std::string& locale =
"C";
72 const std::string& currLocale = setlocale( LC_ALL, NULL );
73 setlocale(LC_ALL, locale.c_str());
75 std::locale previousLocale(out->getloc());
79 std::string
filename = this->GetOutputLocation().c_str();
82 std::string ext = itksys::SystemTools::GetFilenameLastExtension(this->GetOutputLocation().c_str());
88 this->SetOutputLocation(this->GetOutputLocation() + ext);
91 MITK_INFO <<
"Writing fiber bundle as TRK";
93 trk.
create(filename, input.GetPointer());
95 trk.
append(input.GetPointer());
97 setlocale(LC_ALL, currLocale.c_str());
virtual void Write() override
Write the base data to the specified location or output stream.
DataCollection - Class to facilitate loading/accessing structured data.
short append(const mitk::FiberBundle *fib)
static const std::string filename
short create(string m_Filename, const mitk::FiberBundle *fib)
Base Class for Fiber Bundles;.
static const char * GetStaticNameOfClass()
FiberBundleTrackVisWriter()
virtual FiberBundleTrackVisWriter * Clone() const override
us::ServiceRegistration< IFileWriter > RegisterService(us::ModuleContext *context=us::GetModuleContext())
virtual ~FiberBundleTrackVisWriter()
Base class for writing mitk::BaseData objects to files or streams.