Public Member Functions | Protected Member Functions | Protected Attributes

VtkWriter Class Reference

Class that allows to write a bunch of fibers to a .vtk file. More...

#include <vtk_writer.h>

List of all members.

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

Detailed Description

Class that allows to write a bunch of fibers to a .vtk file.


Constructor & Destructor Documentation

virtual VtkWriter::~VtkWriter (  )  [inline, virtual]

Destructor


Member Function Documentation

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.

void VtkWriter::State2Tensor ( State state,
mat_t D,
int  tensorNumber 
) [protected]

Reconstructs the tensor from the state for each case.

Parameters:
[out] D The calculated diffusion tensor
Todo:
I think there is something wrong with choosing a orthonormal basis for the 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.

Parameters:
[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.


Member Data Documentation

const double VtkWriter::_eigenScaleFactor [protected]

Additional scaling of the eigenvalues before writing

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

The diffusion weighted signal data

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

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


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Defines