forked from BRAINSia/BRAINSTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDWIConvertLib.h
168 lines (120 loc) · 3.96 KB
/
DWIConvertLib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
//
// Created by Hui Xie on 12/26/16.
//
#ifndef BRAINSTOOLS_DWICONVERTLIB_H
#define BRAINSTOOLS_DWICONVERTLIB_H
#include "DWIConverter.h"
#include "DWIConverterFactory.h"
// public utility interface for file convert
std::string
detectOuputVolumeType( const std::string & outputVolume );
bool
convertInputVolumeVectorToNrrdOrNifti( const std::string & targetType,
const std::vector< std::string > & inputVolumeVector,
std::vector< std::string > & targetVolumeVector );
bool
convertInputVolumeToNrrdOrNifti( const std::string & targetType, const std::string & inputVolume,
std::string & targetVolume );
class DWIConvert
{
public:
DWIConvert();
DWIConvert( std::string inputVolume, std::string outputVolume = "" );
~DWIConvert();
int
read();
int
write( const std::string & outputVolume );
int
write();
DWIConverter *
getConverter() const;
// get and set methods for private data members
std::string
getInputFileType();
std::string
getOutputFileType();
// currently supported file types: { ".nii", ".nii.gz", ".nhdr", ".nrrd"}
void
SetInputFileName( std::string inputFilePath );
void
SetOutputFileName( std::string outputFilePath );
const std::string &
getInputVolume() const;
void
setInputVolume( const std::string & inputVolume );
const std::string &
getInputDicomDirectory() const;
void
setInputDicomDirectory( const std::string & inputDicomDirectory );
const std::string &
getInputBValues() const;
void
setInputBValues( const std::string & inputBValues );
const std::string &
getInputBVectors() const;
void
setInputBVectors( const std::string & inputBVectors );
const std::string &
getGradientVectorFile() const;
void
setGradientVectorFile( const std::string & gradientVectorFile );
double
getSmallGradientThreshold() const;
void
setSmallGradientThreshold( double smallGradientThreshold );
bool
isfMRIOutput() const;
void
setfMRIOutput( bool fMRIOutput );
bool
isAllowLossyConversion() const;
void
setAllowLossyConversion( bool allowLossyConversion );
bool
isUseIdentityMeasurementFrame() const;
void
setUseIdentityMeasurementFrame( bool useIdentityMeasurementFrame );
bool
isUseBMatrixGradientDirections() const;
void
setUseBMatrixGradientDirections( bool useBMatrixGradientDirections );
const std::string &
getOutputVolume() const;
void
setOutputVolume( const std::string & outputVolume );
const std::string &
getOutputDirectory() const;
void
setOutputDirectory( const std::string & outputDirectory );
const std::string &
getOutputBValues() const;
void
setOutputBValues( const std::string & outputBValues );
const std::string &
getOutputBVectors() const;
void
setOutputBVectors( const std::string & outputBVectors );
private:
DWIConverter *
CreateDicomConverter( const std::string inputDicomDirectory, const bool useBMatrixGradientDirections,
const double smallGradientThreshold, const bool allowLossyConversion );
std::string m_inputFileType;
std::string m_outputFileType;
std::string m_inputVolume;
std::string m_inputDicomDirectory;
std::string m_inputBValues; // default: "" for FSL file
std::string m_inputBVectors; // default: "" for FSL file
std::string m_gradientVectorFile; // deprecated
double m_smallGradientThreshold; // default = 0.2
bool m_fMRIOutput; // default: false
bool m_allowLossyConversion; // defualt: false
bool m_useIdentityMeasurementFrame; // default: false
bool m_useBMatrixGradientDirections; // default: false
std::string m_outputVolume;
std::string m_outputDirectory; // default: "."
std::string m_outputBValues; // default: "" for FSL file
std::string m_outputBVectors; // default: "" for FSL file
DWIConverter * m_converter;
};
#endif // BRAINSTOOLS_DWICONVERTLIB_H