Comments (13)
Thank you for bringing this up @KerstinHut. Could you please share code to reproduce this error?
from pypulseq.
Sorry, I was a little lazy to produce a small example.
The following code produces the float16.seq file I attached, where shape 2 is cut 12 samples short (at the very end of the file). When I change the np.float16 to np.float32 in the compressed shape function, the output is the float32.seq file, which is correct. (I have to pass them as .txt)
import math
from pypulseq.Sequence.sequence import Sequence
from pypulseq.make_gauss_pulse import make_gauss_pulse
from pypulseq.opts import Opts
seq = Sequence()
b1 = 2.22
t = 50e-3
seq_filename = 'float16.seq'
# scanner limits
sys = Opts(max_grad=40, grad_unit='mT/m', max_slew=130, slew_unit='T/m/s', rf_ringdown_time=30e-6, rf_dead_time=100e-6,
rf_raster_time=1e-6)
gamma = sys.gamma * 1e-6
rf_sat, _, _ = make_gauss_pulse(flip_angle=b1 * gamma * 2 * math.pi * t, duration=t, system=sys, time_bw_product=3)
seq.add_block(rf_sat)
seq.write(seq_filename)
from pypulseq.
Hey @sravan953,
I'm a colleague of @KerstinHut and just wanted to give a short explanation why we need such long rf pulses: we wanna use (py)pulseq for magnetization prepared sequences like Chemical Exchange Saturation Transfer (CEST) or Spinlock/T1rho. Especially in CEST rf pulse durations of up to several seconds are pretty common.
from pypulseq.
Hey,
I just wanted to check back on this Issue. We are using pypulseq for several projects at the moment and changing the float type would allow us to use it directly as a submodule in our repos. Would be great!
from pypulseq.
This would be also a very important bug fix for us!
from pypulseq.
Hello! Sorry for the delay, this went under my radar. I have just pushed a commit to the dev branch. To install from dev branch: pip install git+https://github.com/imr-framework/pypulseq.git@dev
from pypulseq.
Hello @KerstinHut , please let me know if things worked out alright?
from pypulseq.
Hello @sravan953 ,
I am sorry I haven't been in touch, I have been busy on another project and forgot to try. The long pulses seem to work now, thank you! I also noticed there is an EXT column in our files now? If I saw correctly, these are also just zeros? We have implemented something similar and can use yours as well, now. Is there anything else we should know about the current dev branch?
Thank you for your help!
from pypulseq.
No problem, just wanted to check in and see if everything was alright. Yes the EXT column is only on the dev branch for now, for external triggering support (see #34).
Do let me know if this issue can be closed.
from pypulseq.
Great, thank you!
from pypulseq.
Hey @sravan953,
we would like to upload our package pypulseq-cest (that requires the pypulseq dev version with the float fix) to PyPi. However, PyPi doesn't allow direct dependencies so that we cannot install pypulseq from the dev branch. (To make it clear: pip install git+https://github.com/imr-framework/pypulseq.git@dev
works, but setting it as dependency in the setup.py of our package does not!) As we would like to avoid including a copy of pypulseq in our package, I wanted to ask if you could
a) push this hot fix to the main branch and release it (e.g. as new maintenance version 1.2.1) so that it we can just set pypulseq as dependency for our package
b) upload the dev-branch (e.g. as pypulseq-dev) to PyPi as well, so that we can use this as dependency. I could do this on my own, but wanted to ask you first and ofc I would also prefer option a) over b)
Best
Patrick
from pypulseq.
Hi @schuenke thanks for bringing this to my notice! :)
I will figure out the best way to do this and get back to you!
from pypulseq.
Hello @schuenke! Hope you are all doing well. I pushed the changes you requested to the main branch and also as a PyPI release. I didn't find time to do any testing, hopefully nothing breaks 😬! Please take a look - https://github.com/imr-framework/pypulseq/releases/tag/1.2.0post4
Let me know if it works :)
from pypulseq.
Related Issues (20)
- np.int and np.float HOT 1
- AttributeError when calling calculate_kspace() in sequence.py HOT 2
- CI Tests HOT 1
- Cannot generate trapezoidal gradient only specifying amplitude and duration. HOT 1
- Arguments of make_block_pulse are highly confusing HOT 3
- make_trapezoid with just flat_area fails HOT 6
- Conda Package for Pypulseq HOT 5
- PyPulseq requires GPU compute (cuPy) on Google Colab HOT 2
- KeyError When Reading .seq File generated from MATLAB pulseq 1.4.0 in pypulseq 1.4.0 HOT 5
- Pypulseq ignores BlockDurationRaster Definition in file
- Compatibility with Pulseq 1.3.1 broken HOT 1
- Feature: Sequence `install`
- Sigpy pulses can not be added to sequence HOT 1
- add_blocks interpolation issue HOT 2
- "Identical" shapes not found in event_lib HOT 4
- Numpy float error when importing pypulseq HOT 1
- Change default branch back to main HOT 1
- Incompatibility of sigpy dependency with scipy 1.14.0 and numpy 2.0 HOT 1
- block duration rounding assertion test HOT 1
- Rounding error in add_gradients leads to incorrect gradient waveforms HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pypulseq.