CBICA Toolkit  1.0.0
cbicaITKComputeDtiScalars.h
Go to the documentation of this file.
1 /**
2 \file cbicaITKComputeDtiScalars.h
3 
4 \brief Declaration of the ComputeDtiScalars class
5 
6 https://www.cbica.upenn.edu/sbia/software/ <br>
7 software@cbica.upenn.edu
8 
9 Copyright (c) 2015 University of Pennsylvania. All rights reserved. <br>
10 See COPYING file or https://www.cbica.upenn.edu/sbia/software/license.html
11 
12 */
13 #pragma once
14 
15 #include <string>
16 #include <iostream>
17 #include <sys/stat.h>
18 
19 #include "itkImageFileReader.h"
20 #include "itkImageFileWriter.h"
21 #include "itkDiffusionTensor3D.h"
22 #include "itkImageRegionConstIteratorWithIndex.h"
23 #include "itkNiftiImageIO.h"
24 #include "itkVector.h"
25 
26 #include "cbicaITKCommonHolder.h"
27 
28 /*
29 \namespace cbica
30 \brief Namespace for differentiating functions written for internal use
31 */
32 namespace cbica
33 {
34  /**
35  \class ComputeDtiScalars
36 
37  \brief Computes the scalars of a single DTI image and writes the output
38 
39  \todo Reuqired for multiple images?
40  */
42  {
43  public:
44 
45  /**
46  \brief Default Constructor
47 
48  Use the SetParameters() method if this is used
49  */
50  explicit ComputeDtiScalars();
51 
52  /**
53  \brief Actual Constructor
54 
55  ALL scalars are computed.
56 
57  \param inputFileName The Input File Name
58  \param output The output file or directory
59  */
60  explicit ComputeDtiScalars( const std::string &inputFileName, const std::string &output );
61 
62  /**
63  \brief Actual Constructor
64 
65  Available options:
66  - FA : FA images
67  - EIG : Eigensystem images
68  - GEO : Geoemtric features
69  - SKEW : Tensor Skewness
70  - KURT : Tensor kurtosis
71  - RADAX: Radial and Axial diffusivity
72  - GORDR: Gordon's R measures
73  - GORDK: Gordon's K measures
74  - ALL : All of the above (default)
75 
76  \param inputFileName The Input File Name
77  \param output The output file or directory
78  \param parameters A string of requested parameters (mixed case characters allowed)
79  */
80  explicit ComputeDtiScalars( const std::string &inputFileName, const std::string &output,
81  const std::string &parameters );
82 
83  /**
84  \brief Actual Constructor
85 
86  \param inputFileName The Input File Name
87  \param output The output file or directory
88  \param parameters A string of requested parameters (mixed case characters allowed)
89  \param prefix Prefix for output. Disregarded if output is file
90  */
91  explicit ComputeDtiScalars( const std::string &inputFileName, const std::string &output,
92  const std::string &parameters, const std::string &prefix );
93 
94  /**
95  \brief The Destructor
96  */
97  virtual ~ComputeDtiScalars();
98 
99  /**
100  \brief Set the object parameters for the default () constructor
101 
102  \param inputFileName The Input File Name
103  \param output Output file/dir
104  \param parameters A string of requested parameters (mixed case characters allowed)
105  \param prefix For written file(s)
106  */
107  void SetParameters( const std::string &inputFileName, const std::string &output,
108  const std::string &parameters, const std::string &prefix );
109 
110  /**
111  \brief Set the object parameters for the default () constructor
112 
113  Since this class utilizes only a single image (for multiple images, it can be called in a loop),
114  setting the input as a vector will tell the algorithm to take the first file only.
115 
116  \param inputFileNames Vector of input files
117  \param output Output file/dir
118  */
119  void SetParameters( const std::vector<std::string> &inputFileNames,
120  const std::string &output, const std::string &prefix );
121 
122 
123  private:
124  // string of parameters
125  std::string m_parameters;
126 
127  bool m_verbose;
128 
129  itk::ImageIOBase::IOComponentType m_component;
130  std::string m_component_asString;
131 
132  /**
133  \brief Run the algorithm
134  */
135  inline void runAlgorithm();
136 
137  /**
138  \brief Extra check for input files
139  */
140  inline void checkInputs() { /* all required parameters are checked by CommonHolder */ };
141 
142  };
143 }
ComputeDtiScalars()
Default Constructor.
virtual ~ComputeDtiScalars()
The Destructor.
Declaration of the CommonHolder class.
void SetParameters(const std::string &inputFileName, const std::string &output, const std::string &parameters, const std::string &prefix)
Set the object parameters for the default () constructor.
Computes the scalars of a single DTI image and writes the output.
Definition: cbicaITKComputeDtiScalars.h:41
Common data container for all statistical computations of images.
Definition: cbicaITKCommonHolder.h:44