17 #ifndef _MITK_FiberfoxParameters_H
18 #define _MITK_FiberfoxParameters_H
20 #include <itkImageRegion.h>
21 #include <itkMatrix.h>
36 #include <boost/property_tree/ptree.hpp>
37 #include <boost/property_tree/xml_parser.hpp>
73 , m_ReversePhase(false)
74 , m_PartialFourier(1.0)
75 , m_NoiseVariance(0.001)
79 , m_SimulateKspaceAcquisition(false)
81 , m_DoDisablePartialVolume(false)
84 , m_KspaceLineOffset(0)
88 , m_DoAddGibbsRinging(false)
89 , m_DoSimulateRelaxation(true)
90 , m_DoAddMotion(false)
91 , m_DoRandomizeMotion(true)
92 , m_FrequencyMap(NULL)
95 m_ImageRegion.SetSize(0, 12);
96 m_ImageRegion.SetSize(1, 12);
97 m_ImageRegion.SetSize(2, 3);
98 m_ImageSpacing.Fill(2.0);
99 m_ImageOrigin.Fill(0.0);
100 m_ImageDirection.SetIdentity();
101 m_Translation.Fill(0.0);
102 m_Rotation.Fill(0.0);
103 SetNumWeightedVolumes(6);
142 itk::Vector<double,3> m_Translation;
148 inline void GenerateGradientHalfShell();
149 inline std::vector< int > GetBaselineIndices();
150 inline unsigned int GetFirstBaselineIndex();
151 inline bool IsBaselineIndex(
unsigned int idx);
152 inline unsigned int GetNumWeightedVolumes();
153 inline unsigned int GetNumBaselineVolumes();
154 inline unsigned int GetNumVolumes();
155 inline GradientListType GetGradientDirections();
156 inline GradientType GetGradientDirection(
unsigned int i);
158 inline void SetNumWeightedVolumes(
int numGradients);
159 inline void SetGradienDirections(GradientListType gradientList);
184 : m_Distribution(DISTRIBUTE_UNIFORM)
192 m_Rotation.Fill(0.0);
193 m_Translation.Fill(0.0);
218 , m_SignalModelString(
"")
219 , m_ArtifactModelString(
"")
220 , m_OutputPath(
"/tmp/")
221 , m_OutputPrefix(
"fiberfox")
222 , m_CheckOutputVolumeFractionsBox(false)
223 , m_CheckAdvancedSignalOptionsBox(false)
224 , m_CheckAddNoiseBox(false)
225 , m_CheckAddGhostsBox(false)
226 , m_CheckAddAliasingBox(false)
227 , m_CheckAddSpikesBox(false)
228 , m_CheckAddEddyCurrentsBox(false)
229 , m_CheckAddDistortionsBox(false)
230 , m_MotionVolumesBox(
"random")
231 , m_CheckRealTimeFibersBox(true)
232 , m_CheckAdvancedFiberOptionsBox(false)
233 , m_CheckConstantRadiusBox(false)
234 , m_CheckIncludeFiducialsBox(true)
267 template<
class ScalarType =
double >
282 template<
class OutType >
291 if (m_NoiseModel!=NULL)
294 out.
m_NoiseModel = std::make_shared< mitk::RicianNoiseModel<OutType> >();
296 out.
m_NoiseModel = std::make_shared< mitk::ChiSquareNoiseModel<OutType> >();
297 out.
m_NoiseModel->SetNoiseVariance(m_NoiseModel->GetNoiseVariance());
300 for (
unsigned int i=0; i<m_FiberModelList.size()+m_NonFiberModelList.size(); i++)
304 if (i<m_FiberModelList.size())
305 signalModel = m_FiberModelList.at(i);
307 signalModel = m_NonFiberModelList.at(i-m_FiberModelList.size());
322 if (i<m_FiberModelList.size())
342 void SaveParameters(
string filename);
343 void LoadParameters(
string filename);
344 template<
class ParameterType >
345 ParameterType ReadVal(boost::property_tree::ptree::value_type
const& v, std::string tag, ParameterType defaultValue,
bool essential=
false);
MiscFiberfoxParameters m_Misc
GUI realted and I/O parameters.
DataNode::Pointer m_ResultNode
Stores resulting image.
double m_Tau
Eddy current decay constant (in ms)
bool m_CheckAdvancedFiberOptionsBox
itk::ImageRegion< 3 > m_CroppedRegion
Image size with reduced FOV.
itk::SmartPointer< Self > Pointer
double m_NoiseVariance
Variance of complex gaussian noise.
itk::Image< double, 3 > ItkDoubleImgType
Generates diffusion measurement employing a second rank tensor model: e^(-bg^TDg) ...
itk::Point< double, 3 > m_ImageOrigin
Image origin.
DiffusionSignalModel< ScalarType > DiffusionModelType
itk::Matrix< double, 3, 3 > m_ImageDirection
Image rotation matrix.
DiffusionNoiseModel< ScalarType > NoiseModelType
bool m_CheckAddDistortionsBox
DiffusionModelListType m_NonFiberModelList
Extra-axonal compartments.
bool m_CheckAddEddyCurrentsBox
unsigned int m_NumGradients
Number of diffusion-weighted image volumes.
double m_tLine
k-space line readout time (dwell time).
bool m_CheckAddAliasingBox
DataCollection - Class to facilitate loading/accessing structured data.
int m_NumberOfCoils
Number of coils in multi-coil acquisition.
double m_Bvalue
Acquisition b-value.
Generates constant direction independent signal.
double m_PartialFourier
Partial fourier factor (0.5-1)
itk::Vector< double, 3 > GradientType
std::vector< GradientType > GradientListType
ItkUcharImgType::Pointer m_MaskImage
Signal is only genrated inside of the mask image.
Generates direction independent diffusion measurement employing a scalar diffusion constant d: e^(-bd...
string m_MotionVolumesBox
bool m_ReversePhase
If true, the phase readout direction will be inverted (-y instead of y)
double m_EddyStrength
Strength of eddy current induced gradients in mT/m.
itk::Vector< double, 3 > m_ImageSpacing
Image voxel size.
double m_SignalScale
Scaling factor for output signal (before noise is added).
Abstract class for diffusion signal models.
mitk::Vector3D m_Rotation
FiberGenerationParameters()
SignalGenerationParameters m_SignalGen
Signal generation parameters.
std::string m_MissingTags
double m_tRep
Echo time TR.
bool m_CheckConstantRadiusBox
bool m_CheckRealTimeFibersBox
bool m_CheckOutputVolumeFractionsBox
The spherical harmonic representation of a prototype diffusion weighted MR signal is used to obtain t...
string m_AfterSimulationMessage
Store messages that are displayed after the simulation has finished (e.g. warnings, automatic parameter adjustments etc.)
unsigned int m_NumBaseline
Number of non-diffusion-weighted image volumes.
Datastructure to manage the Fiberfox signal generation parameters.
FiberGenerationParameters m_FiberGen
Fiber generation parameters.
bool m_DoAddMotion
Enable motion artifacts.
static const std::string filename
itk::Image< unsigned char, 3 > ItkUcharImgType
itk::ImageRegion< 3 > m_ImageRegion
Image size.
double m_AxonRadius
Determines compartment volume fractions (0 == automatic axon radius estimation)
GradientListType m_GradientDirections
Total number of image volumes.
DataNode::Pointer m_ParentNode
Parent node of result node.
Implementation of noise following a chi-squared distribution.
double m_SpikeAmplitude
amplitude of spikes relative to the largest signal intensity (magnitude of complex) ...
SignalGenerationParameters()
AcquisitionType m_AcquisitionType
determines k-space trajectory and maximum echo position(s)
itk::Image< unsigned char, 3 > ItkUcharImgType
FlipListType m_FlipList
contains flags indicating a flip of the 2D fiber x-coordinates (needed to resolve some unwanted fiber...
string m_SignalModelString
Appendet to the name of the result node.
mitk::Vector3D m_Translation
Realizes EPI readout: one echo, maximum intensity in the k-space center, zig-zag trajectory.
bool m_DoSimulateRelaxation
Add T2 relaxation effects.
vector< vector< unsigned int > > FlipListType
itk::Vector< double, 3 > m_Rotation
Maximum rotational motion.
Generates the diffusion signal using an idealised cylinder with zero radius: e^(-bd(ng)²) ...
CoilSensitivityProfile m_CoilSensitivityProfile
Choose between constant, linear or exponential sensitivity profile of the used coils.
double m_CroppingFactor
FOV size in y-direction is multiplied by this factor. Causes aliasing artifacts.
vector< vector< mitk::PlanarEllipse::Pointer > > FiducialListType
bool m_DoAddGibbsRinging
Add Gibbs ringing artifact.
unsigned int m_Spikes
Number of spikes randomly appearing in the image.
bool m_DoDisablePartialVolume
Disable partial volume effects. Each voxel is either all fiber or all non-fiber.
string m_OutputPath
Image is automatically saved to the specified folder after simulation is finished.
itk::Image< double, 3 > ItkDoubleImgType
bool m_CheckAdvancedSignalOptionsBox
Implementation of noise following a rician distribution.
DiffusionModelListType m_FiberModelList
Intra- and inter-axonal compartments.
double m_tEcho
Echo time TE.
std::shared_ptr< NoiseModelType > m_NoiseModel
If != NULL, noise is added to the image.
Abstract class for diffusion noise models.
bool m_DoRandomizeMotion
Toggles between random and linear motion.
double m_KspaceLineOffset
Causes N/2 ghosts. Larger offset means stronger ghost.
Generates the diffusion signal using a collection of idealised cylinder with zero radius: e^(-bd(ng)²...
string m_ArtifactModelString
Appendet to the name of the result node.
FiberfoxParameters< OutType > CopyParameters()
FiducialListType m_Fiducials
container of the planar ellipses used as fiducials for the fiber generation process ...
bool m_SimulateKspaceAcquisition
Flag to enable/disable k-space acquisition simulation.
std::vector< DiffusionModelType * > DiffusionModelListType
FiberDistribution m_Distribution
ItkDoubleImgType::Pointer m_FrequencyMap
If != NULL, distortions are added to the image using this frequency map.
Class for nodes of the DataTree.
bool m_CheckIncludeFiducialsBox
std::vector< bool > m_MotionVolumes
with positive numbers, inverted logic with negative numbers.
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.