Skip to content

Commit e811afb

Browse files
committed
typo fixed
1 parent a21e707 commit e811afb

File tree

2 files changed

+22
-15
lines changed

2 files changed

+22
-15
lines changed

src/file_utils.cpp

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,20 +102,23 @@ bool file_utils::read_config(std::string config_filename, simulation_parameters
102102
}
103103
filenames["output"] = file_paths;
104104

105-
// check header of fieldmap matches
106-
auto dims = file_utils::get_size_h5(filenames.at("phantom")[0], "mask");
107-
if(dims.size() != 3)
105+
if(param->n_fieldmaps > 0)
108106
{
109-
BOOST_LOG_TRIVIAL(error) << cf_name << ") " << "mask must be 3D but is " << dims.size() << "D filename:"<< filenames.at("phantom")[0] << ". Aborting...!";
110-
return false;
111-
}
112-
std::vector<float> fov(3, 0);
113-
file_utils::read_h5(filenames.at("phantom")[0], fov.data(), "fov", "float");
114-
std::copy(dims.begin(), dims.end(), param->fieldmap_size);
115-
std::copy(fov.begin(), fov.end(), param->fov);
107+
// check header of fieldmap matches
108+
auto dims = file_utils::get_size_h5(filenames.at("phantom")[0], "mask");
109+
if(dims.size() != 3)
110+
{
111+
BOOST_LOG_TRIVIAL(error) << cf_name << ") " << "mask must be 3D but is " << dims.size() << "D filename:"<< filenames.at("phantom")[0] << ". Aborting...!";
112+
return false;
113+
}
114+
std::vector<float> fov(3, 0);
115+
file_utils::read_h5(filenames.at("phantom")[0], fov.data(), "fov", "float");
116+
std::copy(dims.begin(), dims.end(), param->fieldmap_size);
117+
std::copy(fov.begin(), fov.end(), param->fov);
116118

117-
param->fieldmap_exist = file_utils::get_size_h5(filenames.at("phantom")[0], "fieldmap").size() == 3;
118-
param->mask_exist = file_utils::get_size_h5(filenames.at("phantom")[0], "mask").size() == 3;
119+
param->fieldmap_exist = file_utils::get_size_h5(filenames.at("phantom")[0], "fieldmap").size() == 3;
120+
param->mask_exist = file_utils::get_size_h5(filenames.at("phantom")[0], "mask").size() == 3;
121+
}
119122

120123
// ============== reading section SCAN_PARAMETERS ==============
121124
param->TR_us = (int32_t)pt.get<float>("SCAN_PARAMETERS.TR", param->TR_us);

src/spinwalk.cu

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,16 @@ bool run(simulation_parameters param, std::map<std::string, std::vector<std::str
178178
{
179179
param_local.fov[i] = fov_scale[sl] * param.fov[i];
180180
param_local.scale2grid[i] = param_local.fieldmap_size[i] / param_local.fov[i];
181-
for (int n = 0; n < param.n_tissue_type; i++)
182-
if(param_local.fov[i] < 100 * param.diffusivity[n])
181+
for (int n = 0; n < param.n_tissue_type; n++)
182+
{
183+
double min_convergence = 2 * param.diffusivity[n] * sqrt(10 * param.n_timepoints); // https://submissions.mirasmart.com/ISMRM2024/Itinerary/PresentationDetail.aspx?evdid=4684
184+
if(param_local.fov[i] < min_convergence )
183185
{
184-
BOOST_LOG_TRIVIAL(error) << "FoV (= " << param_local.fov[i] << ") must be 100x larger than sqrt(2*diffusivity*timestep) (= " << param.diffusivity[n] << ")!";
186+
BOOST_LOG_TRIVIAL(error) << "Virtual FoV (= " << param_local.fov[i] << ") is smaller than minimum convergence length (= " << min_convergence << ")!";
187+
BOOST_LOG_TRIVIAL(error) << "Original FoV (= " << param.fov[i] << ") FoV Scale (= " << fov_scale[sl] << ")!";
185188
return false;
186189
}
190+
}
187191
}
188192

189193
if(param.no_gpu)

0 commit comments

Comments
 (0)