imr-framework / pypulseq

Pulseq in Python
https://pypulseq.readthedocs.io
GNU Affero General Public License v3.0
115 stars 62 forks source link

Adding delay is breaking seq.report #31

Closed sairamgeethanath closed 4 years ago

sairamgeethanath commented 4 years ago

Describe the bug seq.report() is unable to detect a Cartesian trajectory for a spin echo implementation

To Reproduce

report = seq.report() print(report)

Expected behavior Needs to show that it is 2D Cartesian with spatial resolutions only in x and y

Screenshots Output from report API - wth delay commented Number of blocks: 512 Number of events: RF: 256 Gx: 256 Gy: 128 Gz: 384 ADC: 128 Delay: 0 Sequence duration: 1.840640 s TE: 0.009571 s TR: 0.014380 s Flip angle: 90.00 180.00 deg Unique k-space positions (aka cols, rows, etc.): 128 128 1 Dimensions: 3 Spatial resolution: 1.95 mm Spatial resolution: 1.95 mm Spatial resolution: 31.25 mm Repetitions/slices/contrasts: 1.0 Cartesian encoding trajectory detected Block timing check passed successfully Max gradient: 107246 103226 666667 Hz/m == 2.52 2.42 15.66 mT/m Max slew rate: 5362275148 5333333333 5333333333 Hz/m/s == 125.95 125.27 125.27 mT/m/s Max absolute gradient: 666667 Hz/m == 15.66 mT/m Max absolute slew rate: 7.90635e+09 Hz/m/s == 185.70 T/m/s

Desktop (please complete the following information):

Additional context If I uncomment the delays, the report cannot evaluate block timings; Block timing check failed. Error listing follows:

sairamgeethanath commented 4 years ago

seq.report thinks it is 3D because of this line: seq.add_block(gz_reph, gx_pre, gy_pre) but the same line in write_gre.py does not seem to break it! It is not necessary that the presence of 3 gradients along different directions need to be a 3D sequence

sairamgeethanath commented 4 years ago

The old issue of delay not being an integer multiple of system.grad_raster_time is having sporadic issues here in the report. Fixed temporarily with fcee890098010fe9d97676746c1c0db7c9f04eb4