Skip to content
Snippets Groups Projects
Unverified Commit 0ee3166c authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

Fix rounding of raster times

parent e89bcabe
No related branches found
No related tags found
1 merge request!1Add writing to Pulseq files
...@@ -122,7 +122,7 @@ function PulseqBlock(block::BaseBuildingBlock; BlockDurationRaster, AdcRasterTim ...@@ -122,7 +122,7 @@ function PulseqBlock(block::BaseBuildingBlock; BlockDurationRaster, AdcRasterTim
PulseqShape(gen.amplitude ./ maximum(gen.amplitude)), PulseqShape(gen.amplitude ./ maximum(gen.amplitude)),
PulseqShape(deg2rad.(gen.phase)), PulseqShape(deg2rad.(gen.phase)),
PulseqShape(gen.time .* 1e-3), PulseqShape(gen.time .* 1e-3),
Int(div(delay, 1e-3)), Int(div(delay, 1e-3, RoundNearest)),
0., 0.,
0. 0.
) )
...@@ -132,8 +132,8 @@ function PulseqBlock(block::BaseBuildingBlock; BlockDurationRaster, AdcRasterTim ...@@ -132,8 +132,8 @@ function PulseqBlock(block::BaseBuildingBlock; BlockDurationRaster, AdcRasterTim
end end
adc = PulseqADC( adc = PulseqADC(
nsamples(event), nsamples(event),
div(dwell_time(event), AdcRasterTime), div(dwell_time(event), AdcRasterTime, RoundNearest),
Int(div(delay, 1e-3)), Int(div(delay, 1e-3, RoundNearest)),
0., 0. 0., 0.
) )
else else
...@@ -158,7 +158,7 @@ function PulseqBlock(block::BaseBuildingBlock; BlockDurationRaster, AdcRasterTim ...@@ -158,7 +158,7 @@ function PulseqBlock(block::BaseBuildingBlock; BlockDurationRaster, AdcRasterTim
end end
return PulseqBlock( return PulseqBlock(
Int(div(1e-3 * duration(block), BlockDurationRaster)), Int(div(1e-3 * duration(block), BlockDurationRaster, RoundNearest)),
rf, rf,
grads..., grads...,
adc, adc,
......
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