imr-framework / pypulseq

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

Add missing input set case for trapezoids. #86

Closed btasdelen closed 2 years ago

btasdelen commented 2 years ago

There is a missing case for defining trapezoids, when rise time, flat time and area is given. It causes the amplitude to be calculated as flat_area/flat_time, which evaluates to 0 and causes trapezoid to be a 0 area trapezoid. This commit adds the missing case.

sravan953 commented 2 years ago

Thanks for the PR! What use case would this address?

btasdelen commented 2 years ago

It will address the case where we want two gradients to have the exact same timing (rise time and flat time), but different areas.

A more specific use case that I encountered: I wanted to design bridged spoilers for spin echo, that have the same timing, but different areas (4pi and 8pi), in order to cycle between different spoilers so that we can avoid unwanted stimulated echoes. Having the spoilers with exact same timing simplifies the bridging and sequence timing.

btasdelen commented 2 years ago

PR had a small bug causing some input sets to throw an exception, but it's fixed and tested now.