Class that allows to write a bunch of fibers to a .vtk file. More...
#include <vtk_writer.h>
Public Member Functions | |
| VtkWriter (const ISignalData *signal_data, Tractography::model_type filter_model_type, bool write_tensors) | |
| Constructor. | |
| virtual | ~VtkWriter () |
| bool | Write (const std::string &file_name, const std::string &tractsWithSecondTensor, const std::vector< Fiber > &fibers, bool write_state, bool store_glyphs) |
| Writes the fibers to the VTK file and attaches the selected values to the fiber. | |
| bool | WriteGlyphs (const std::string &file_name, const std::vector< Fiber > &fibers) |
| void | set_transform_position (bool transform_position) |
Protected Member Functions | |
| void | WritePoint (const vec_t &point, std::ofstream &output, int &counter) |
| void | writeFibersAndTensors (std::ofstream &output, const std::vector< Fiber > &fibers, const int tensorNumber) |
| void | State2Tensor (State &state, mat_t &D, int tensorNumber) |
| Reconstructs the tensor from the state for each case. | |
Protected Attributes | |
| const ISignalData * | _signal_data |
| bool | _transform_position |
| const Tractography::model_type | _filter_model_type |
| const double | _scale_glyphs |
| bool | _write_tensors |
| int | _p_l1 |
| int | _p_l2 |
| int | _p_l3 |
| int | _p_m1 |
| int | _p_m2 |
| int | _p_m3 |
| int | _p_psi |
| int | _p_theta |
| int | _p_phi |
| int | _tensor_space |
| int | _num_tensors |
| bool | _full |
| const double | _eigenScaleFactor |
| mat_t | _sizeFreeI2R |
Class that allows to write a bunch of fibers to a .vtk file.
| virtual VtkWriter::~VtkWriter | ( | ) | [inline, virtual] |
Destructor
| void VtkWriter::set_transform_position | ( | bool | transform_position | ) | [inline] |
Sets the variable that toggles the transform from ijk to RAS before writing the fiber to VTK.
Reconstructs the tensor from the state for each case.
| [out] | D | The calculated diffusion tensor |
| bool VtkWriter::Write | ( | const std::string & | file_name, | |
| const std::string & | tractsWithSecondTensor, | |||
| const std::vector< Fiber > & | fibers, | |||
| bool | write_state, | |||
| bool | store_glyphs | |||
| ) |
Writes the fibers to the VTK file and attaches the selected values to the fiber.
| [in] | file_name | The path of the output fiber file (*.vtk) |
| [in] | tractsWithSecondTensor | File path for the fibers generated with the second tensor This one is optional. |
| [in] | store_glyphs | Write glyphs (i.e. main tensor directions) to a file named glyphs_{tracts}. |
| void VtkWriter::writeFibersAndTensors | ( | std::ofstream & | output, | |
| const std::vector< Fiber > & | fibers, | |||
| const int | tensorNumber | |||
| ) | [protected] |
Writes the fibers and all values attached to them to a VTK file
| bool VtkWriter::WriteGlyphs | ( | const std::string & | file_name, | |
| const std::vector< Fiber > & | fibers | |||
| ) |
Write the glyphs (i.e. main tensor directions) to a file named glyphs_{tracts}.
| void VtkWriter::WritePoint | ( | const vec_t & | point, | |
| std::ofstream & | output, | |||
| int & | counter | |||
| ) | [protected] |
Writes a point to the output stream, and performs the ijk-RAS transform if set to do so. Also this function makes sure that the output VTK file is well formatted.
const double VtkWriter::_eigenScaleFactor [protected] |
Additional scaling of the eigenvalues before writing
const Tractography::model_type VtkWriter::_filter_model_type [protected] |
What model was the tractography performed with
bool VtkWriter::_full [protected] |
Was the full or simplified tensor model used?
int VtkWriter::_num_tensors [protected] |
The number of tensors used
const double VtkWriter::_scale_glyphs [protected] |
Scaling of the glyphs
const ISignalData* VtkWriter::_signal_data [protected] |
The diffusion weighted signal data
mat_t VtkWriter::_sizeFreeI2R [protected] |
Transformation matrix from ijk-RAS with voxel size normalized out
int VtkWriter::_tensor_space [protected] |
How many indeces in the state are used up by 1 tensor
bool VtkWriter::_transform_position [protected] |
If set to true, WritePoint will convert the points from ijk to RAS space before writing
bool VtkWriter::_write_tensors [protected] |
Whether to attach the tensors to the fiber
1.7.1