Go to the documentation of this file.00001
00009 #ifndef VTK_WRITER_H_
00010 #define VTK_WRITER_H_
00011
00012 #include <string>
00013 #include <vector>
00014 #include "linalg.h"
00015 #include "tractography.h"
00016
00017 struct Fiber;
00018
00019 class ISignalData;
00020
00025 class VtkWriter
00026 {
00027 public:
00031 VtkWriter(const ISignalData *signal_data, Tractography::model_type filter_model_type, bool write_tensors);
00032
00034 virtual ~VtkWriter() { }
00035
00043 bool Write(const std::string& file_name, const std::string &tractsWithSecondTensor,
00044 const std::vector<Fiber>& fibers, bool write_state,
00045 bool store_glyphs);
00046
00048 bool WriteGlyphs(const std::string& file_name,
00049 const std::vector<Fiber>& fibers);
00050
00052 void set_transform_position(bool transform_position) {
00053 _transform_position = transform_position;
00054 }
00055
00056 protected:
00061 void WritePoint(const vec_t& point, std::ofstream& output, int& counter);
00062
00066 void writeFibersAndTensors(std::ofstream &output, const std::vector<Fiber>& fibers, const int tensorNumber) ;
00067
00073 void State2Tensor(State & state, mat_t & D, int tensorNumber);
00074
00076 const ISignalData *_signal_data;
00077
00079 bool _transform_position;
00080
00082 const Tractography::model_type _filter_model_type;
00083
00085 const double _scale_glyphs;
00086
00088 bool _write_tensors;
00089
00090
00091 int _p_l1, _p_l2, _p_l3;
00092 int _p_m1, _p_m2, _p_m3;
00093 int _p_psi, _p_theta, _p_phi;
00094
00096 int _tensor_space;
00097
00099 int _num_tensors;
00100
00102 bool _full;
00103
00105 const double _eigenScaleFactor;
00106
00108 mat_t _sizeFreeI2R;
00109 };
00110
00111 #endif // VTK_WRITER_H_