Skip to content
Snippets Groups Projects
Verified Commit d682a330 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Raise error if slice_thickness is incorrectly set

parent fc4abd90
No related branches found
No related tags found
No related merge requests found
...@@ -56,6 +56,9 @@ function excitation_pulse(; flip_angle=90, phase=0., frequency=0., shape=nothing ...@@ -56,6 +56,9 @@ function excitation_pulse(; flip_angle=90, phase=0., frequency=0., shape=nothing
if length(bad_keys) > 0 if length(bad_keys) > 0
error("Unrecognised keyword arguments in call of `excitation_pulse`: $bad_keys") error("Unrecognised keyword arguments in call of `excitation_pulse`: $bad_keys")
end end
if isnothing(slice_thickness) || slice_thickness isa Symbol
error("slice thickness cannot be a free parameter")
end
if isnothing(shape) if isnothing(shape)
shape = isinf(slice_thickness) ? :instant : :sinc shape = isinf(slice_thickness) ? :instant : :sinc
end end
...@@ -114,6 +117,9 @@ function refocus_pulse(; flip_angle=180, phase=0., frequency=0., shape=nothing, ...@@ -114,6 +117,9 @@ function refocus_pulse(; flip_angle=180, phase=0., frequency=0., shape=nothing,
if length(bad_keys) > 0 if length(bad_keys) > 0
error("Unrecognised keyword arguments in call of `refocus_pulse`: $bad_keys") error("Unrecognised keyword arguments in call of `refocus_pulse`: $bad_keys")
end end
if isnothing(slice_thickness) || slice_thickness isa Symbol
error("slice thickness cannot be a free parameter")
end
if isnothing(shape) if isnothing(shape)
shape = isinf(slice_thickness) ? :instant : :sinc shape = isinf(slice_thickness) ? :instant : :sinc
end end
...@@ -240,7 +246,7 @@ function interpret_image_size(fov, resolution, voxel_size, slice_thickness) ...@@ -240,7 +246,7 @@ function interpret_image_size(fov, resolution, voxel_size, slice_thickness)
_real_value(other) = false _real_value(other) = false
if all(isnothing.((fov, resolution, voxel_size))) if all(isnothing.((fov, resolution, voxel_size)))
return (slice_thickness, nothing, (fov=nothing, resolution=nothing, voxel_size=nothing)) return (isnothing(voxel_size) ? Inf : voxel_size, nothing, (fov=nothing, resolution=nothing, voxel_size=nothing))
end end
if !_real_value(resolution) if !_real_value(resolution)
if !(_real_value(fov) && _real_value(voxel_size)) if !(_real_value(fov) && _real_value(voxel_size))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment