Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip trailing spaces and convert tabs to spaces #157

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions ukf/NrrdData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void NrrdData::Interp3Signal(const vec3_t& pos,
signal[i] /= w_sum;

// Push into second spot.
signal[i + _num_gradients] = signal[i]; // Duplicate the signals
signal[i + _num_gradients] = signal[i]; // Duplicate the signals
}

}
Expand Down Expand Up @@ -419,7 +419,7 @@ bool NrrdData::LoadSignal(Nrrd* input_nrrd, const bool normalizedDWIData)
else
{
this->_data_nrrd = nrrdNew();
dwiNormalize(input_nrrd, _data_nrrd); // Do preprocessing on the data
dwiNormalize(input_nrrd, _data_nrrd); // Do preprocessing on the data
}

// After normalization, the first axis of the nrrd data is the list, namely the gradient axis
Expand Down Expand Up @@ -493,7 +493,7 @@ bool NrrdData::LoadSignal(Nrrd* input_nrrd, const bool normalizedDWIData)
nrrdSpacingCalculate(this->_data_nrrd, 1, &spacing1, space_dir);
nrrdSpacingCalculate(this->_data_nrrd, 2, &spacing2, space_dir);
nrrdSpacingCalculate(this->_data_nrrd, 3, &spacing3, space_dir);
_voxel << spacing3, spacing2, spacing1; // NOTE that the _voxel here is in reverse axis order!
_voxel << spacing3, spacing2, spacing1; // NOTE that the _voxel here is in reverse axis order!

// make sure something computable is in spacing.
for(unsigned int i = 0; i < this->_data_nrrd->dim; ++i)
Expand Down Expand Up @@ -569,8 +569,8 @@ bool NrrdData::LoadSignal(Nrrd* input_nrrd, const bool normalizedDWIData)

R(0, 0) *= vox_x_inv;
R(1, 0) *= vox_x_inv;
R(2, 0) *= vox_x_inv; // R(0,0), R(1,0), R(2,0) is a unit vector, and is just the normalized spacedirection of axis
// 1
R(2, 0) *= vox_x_inv; // R(0,0), R(1,0), R(2,0) is a unit vector, and is just the normalized spacedirection of axis
// 1
R(0, 1) *= vox_y_inv;
R(1, 1) *= vox_y_inv;
R(2, 1) *= vox_y_inv;
Expand Down
24 changes: 12 additions & 12 deletions ukf/cli.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ int ukf_parse_cli(int argc, char** argv, UKFSettings& s)
// HANDLE ERRORNOUS INPUT
if (dwiFile.empty() || maskFile.empty() || tracts.empty()) {
std::cout << "Error! Must indicate DWI data, mask and tracts output files!" << std::endl << std::endl ;
return 1 ; //This is to indicate that the module returns with error
return 1 ; //This is to indicate that the module returns with error
}

if (numTensor == 1) {
tractsWithSecondTensor.clear() ; //Reassure the string is empty
tractsWithSecondTensor.clear() ; //Reassure the string is empty
}

if (l_maxHalfFiberLength <= 0) {
Expand Down Expand Up @@ -137,7 +137,7 @@ int ukf_parse_cli(int argc, char** argv, UKFSettings& s)

if (l_seedingThreshold == 0.0) {
ukf_setAndTell(l_seedingThreshold, FULL_BRAIN_MEAN_SIGNAL_MIN,
"seedingThreshold"); // Used to default to 2 times the FA threshold.
"seedingThreshold"); // Used to default to 2 times the FA threshold.
} else {
ukf_tell(l_seedingThreshold, "seedingThreshold");
}
Expand All @@ -156,12 +156,12 @@ int ukf_parse_cli(int argc, char** argv, UKFSettings& s)
else
ukf_setAndTell(l_Qm, 0.001, "Qm");
} else if (numTensor == 1) {
ukf_setAndTell(l_Qm, 0.005, "Qm");//l_Qm = 0.0015;
ukf_setAndTell(l_Qm, 0.005, "Qm"); //l_Qm = 0.0015;
} else {
if (fullTensorModel) {
ukf_setAndTell(l_Qm, 0.002, "Qm");//l_Qm = 0.002;
ukf_setAndTell(l_Qm, 0.002, "Qm"); //l_Qm = 0.002;
} else {
ukf_setAndTell(l_Qm, 0.001, "Qm");//l_Qm = 0.001; was 0.003, changed to 0.001 for new Interp3Signal
ukf_setAndTell(l_Qm, 0.001, "Qm"); //l_Qm = 0.001; was 0.003, changed to 0.001 for new Interp3Signal
}
}
} else {
Expand All @@ -178,11 +178,11 @@ int ukf_parse_cli(int argc, char** argv, UKFSettings& s)
else {
if (l_Ql == 0.0) {
if (numTensor == 1) {
ukf_setAndTell(l_Ql, 300.0, "Ql");//l_Ql = 25.0;
ukf_setAndTell(l_Ql, 300.0, "Ql"); //l_Ql = 25.0;
} else if (numTensor == 2) {
ukf_setAndTell(l_Ql, 50.0, "Ql");//was l_Ql = 100.0; for old Interp3Signal
ukf_setAndTell(l_Ql, 50.0, "Ql"); //was l_Ql = 100.0; for old Interp3Signal
} else if (numTensor == 3) {
ukf_setAndTell(l_Ql, 100.0, "Ql");//l_Ql = 150.0;
ukf_setAndTell(l_Ql, 100.0, "Ql"); //l_Ql = 150.0;
}
} else {
ukf_tell(l_Ql, "Ql");
Expand All @@ -192,12 +192,12 @@ int ukf_parse_cli(int argc, char** argv, UKFSettings& s)

if (l_Rs == 0.0) {
if (numTensor == 1) {
ukf_setAndTell(l_Rs, 0.01, "Rs");//l_Rs = 0.02;
ukf_setAndTell(l_Rs, 0.01, "Rs"); //l_Rs = 0.02;
} else {
if (fullTensorModel) {
ukf_setAndTell(l_Rs, 0.01, "Rs");// = 0.01;
ukf_setAndTell(l_Rs, 0.01, "Rs"); // = 0.01;
} else {
ukf_setAndTell(l_Rs, 0.02, "Rs");//was l_Rs = 0.015;for old Interp3Signal
ukf_setAndTell(l_Rs, 0.02, "Rs"); //was l_Rs = 0.015;for old Interp3Signal
}
}
} else {
Expand Down
6 changes: 3 additions & 3 deletions ukf/dwi_normalize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void dwiNormalize(const Nrrd *raw, Nrrd *& normalized)
throw;
}

nrrdKeyValueClear(normalized); // Force to erase the key/value pairs
nrrdKeyValueClear(normalized); // Force to erase the key/value pairs

// Process the key/value pairs. Identify the non-zero gradients, namely the non-zero B values
std::vector<std::pair<std::string, std::string> > keyValuePairsOfRaw;
Expand Down Expand Up @@ -149,7 +149,7 @@ void dwiNormalize(const Nrrd *raw, Nrrd *& normalized)
// Compute the permutation
std::vector<unsigned int> permutation(DATA_DIMENSION);
unsigned int permuteCounter = 0;
permutation[0] = static_cast<unsigned int>(listAxis); // Shift the list axis to the fastest axis
permutation[0] = static_cast<unsigned int>(listAxis); // Shift the list axis to the fastest axis
for( int i = 1; i < DATA_DIMENSION; i++ )
{
if( permuteCounter == static_cast<unsigned int>(listAxis) )
Expand Down Expand Up @@ -272,7 +272,7 @@ void dwiNormalize(const Nrrd *raw, Nrrd *& normalized)
if( normalized->content != NULL )
{
free( normalized->content );
normalized->content = NULL; // Get rid of the content field
normalized->content = NULL; // Get rid of the content field
}
// Add the key/value pairs back to the normalized data
int totalGradientCounter = 0;
Expand Down
10 changes: 5 additions & 5 deletions ukf/filter_Full1T_FW.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ class Full1T_FW : public FilterModel

// Setting the constraints according to D'*x >= -d
_D(6, 0) = -1;
_d(0) = 1; // w <= 1
_d(0) = 1; // w <= 1
_D(6, 1) = 1;
_d(1) = 0; // w >= 0
_d(1) = 0; // w >= 0
_D(3, 2) = 1;
_d(2) = 0; // l1 >= 0
_d(2) = 0; // l1 >= 0
_D(4, 3) = 1;
_d(3) = 0; // l2 >= 0
_d(3) = 0; // l2 >= 0
_D(5, 4) = 1;
_d(4) = 0; // l3 >= 0
_d(4) = 0; // l3 >= 0

}

Expand Down
16 changes: 8 additions & 8 deletions ukf/filter_Full2T_FW.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ class Full2T_FW : public FilterModel

// Setting the constraints according to D'*x >= -d
_D(12, 0) = -1;
_d(0) = 1; // w <= 1
_d(0) = 1; // w <= 1
_D(12, 1) = 1;
_d(1) = 0; // w >= 0
_d(1) = 0; // w >= 0
_D(3, 2) = 1;
_d(2) = 0; // l11 >= 0
_d(2) = 0; // l11 >= 0
_D(4, 3) = 1;
_d(3) = 0; // l21 >= 0
_d(3) = 0; // l21 >= 0
_D(5, 4) = 1;
_d(4) = 0; // l31 >= 0
_d(4) = 0; // l31 >= 0
_D(9, 5) = 1;
_d(5) = 0; // l12 >= 0
_d(5) = 0; // l12 >= 0
_D(10, 6) = 1;
_d(6) = 0; // l22 >= 0
_d(6) = 0; // l22 >= 0
_D(11, 7) = 1;
_d(7) = 0; // l32 >= 0
_d(7) = 0; // l32 >= 0
}

virtual ~Full2T_FW()
Expand Down
10 changes: 5 additions & 5 deletions ukf/filter_NODDI1F.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ class NODDI1F : public FilterModel

// Setting the constraints according to D'*x >= -d
_D(5, 0) = -1;
_d(0) = 1; // Viso <= 1
_d(0) = 1; // Viso <= 1
_D(5, 1) = 1;
_d(1) = 0; // Viso >= 0
_d(1) = 0; // Viso >= 0

_D(3, 2) = 1;
_d(2) = 0; // Vic >= 0
_d(2) = 0; // Vic >= 0
_D(3, 3) = -1;
_d(3) = 1; // Vic <= 1
_d(3) = 1; // Vic <= 1

_D(4, 4) = 1;
_d(4) = 0; // kappa >= 0
_d(4) = 0; // kappa >= 0

}

Expand Down
16 changes: 8 additions & 8 deletions ukf/filter_NODDI2F.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,25 @@ class NODDI2F : public FilterModel

// Setting the constraints according to D'*x >= -d
_D(10, 0) = -1;
_d(0) = 1; // Viso <= 1
_d(0) = 1; // Viso <= 1
_D(10, 1) = 1;
_d(1) = 0; // Viso >= 0
_d(1) = 0; // Viso >= 0

_D(3, 2) = 1;
_d(2) = 0; // Vic >= 0
_d(2) = 0; // Vic >= 0
_D(3, 3) = -1;
_d(3) = 1; // Vic <= 1
_d(3) = 1; // Vic <= 1

_D(4, 4) = 1;
_d(4) = 0; // kappa >= 0
_d(4) = 0; // kappa >= 0

_D(8, 5) = 1;
_d(5) = 0; // Vic >= 0
_d(5) = 0; // Vic >= 0
_D(8, 6) = -1;
_d(6) = 1; // Vic <= 1
_d(6) = 1; // Vic <= 1

_D(9, 7) = 1;
_d(7) = 0; // kappa >= 0
_d(7) = 0; // kappa >= 0

}

Expand Down
8 changes: 4 additions & 4 deletions ukf/filter_Simple1T_FW.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ class Simple1T_FW : public FilterModel

// Setting the constraints according to D'*x >= -d
_D(5, 0) = -1;
_d(0) = 1; // w <= 1
_d(0) = 1; // w <= 1
_D(5, 1) = 1;
_d(1) = 0; // w >= 0
_d(1) = 0; // w >= 0
_D(3, 2) = 1;
_d(2) = 0; // l1 >= 0
_d(2) = 0; // l1 >= 0
_D(4, 3) = 1;
_d(3) = 0; // l2 >= 0
_d(3) = 0; // l2 >= 0

}

Expand Down
12 changes: 6 additions & 6 deletions ukf/filter_Simple2T_FW.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ class Simple2T_FW : public FilterModel

// Setting the constraints according to D'*x >= -d
_D(10, 0) = -1;
_d(0) = 1; // w <= 1
_d(0) = 1; // w <= 1
_D(10, 1) = 1;
_d(1) = 0; // w >= 0
_d(1) = 0; // w >= 0
_D(3, 2) = 1;
_d(2) = 0; // l11 >= 0
_d(2) = 0; // l11 >= 0
_D(4, 3) = 1;
_d(3) = 0; // l21 >= 0
_d(3) = 0; // l21 >= 0
_D(8, 4) = 1;
_d(4) = 0; // l12 >= 0
_d(4) = 0; // l12 >= 0
_D(9, 5) = 1;
_d(5) = 0; // l22 >= 0
_d(5) = 0; // l22 >= 0
}

virtual ~Simple2T_FW()
Expand Down
Loading
Loading