Skip to content

Commit 3f11466

Browse files
committed
Merge branch 'T27318-IvimFit'
2 parents 32e83db + 0076144 commit 3f11466

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Modules/DiffusionCore/Algorithms/Reconstruction/itkDiffusionIntravoxelIncoherentMotionReconstructionImageFilter.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,12 +454,17 @@ ::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, Threa
454454
meas_m /= input.N;
455455

456456
vnl_matrix<double> X(input.N,2);
457+
bool nan_element = false;
457458
for(int i=0; i<input.N; i++)
458459
{
459460
X(i,0) = input.bvals[i] - bval_m;
460461
X(i,1) = input.meas[i] - meas_m;
462+
if (std::isnan(X(i,1)) || std::isnan(X(i,1)))
463+
nan_element = true;
461464
}
462465

466+
if (!nan_element)
467+
{
463468
vnl_matrix<double> XX = X.transpose() * X;
464469
vnl_symmetric_eigensystem<double> eigs(XX);
465470

@@ -505,6 +510,7 @@ ::ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread, Threa
505510

506511
m_Snap.currentDStar = min_val + opt_idx * ((max_val-min_val) / num_its);
507512
}
513+
}
508514
// MITK_INFO << "choosing " << opt_idx << " => " << DStar;
509515
// x_dstar_only[0] = 0.01;
510516
// // f 0.1 Dstar 0.01 D 0.001

0 commit comments

Comments
 (0)