Coder Social home page Coder Social logo

Comments (13)

sravan953 avatar sravan953 commented on August 25, 2024

Thank you for bringing this up @KerstinHut. Could you please share code to reproduce this error?

from pypulseq.

KerstinKaspar avatar KerstinKaspar commented on August 25, 2024

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)

float16.txt
float32.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.

schuenke avatar schuenke commented on August 25, 2024

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.

schuenke avatar schuenke commented on August 25, 2024

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.

mzaiss avatar mzaiss commented on August 25, 2024

This would be also a very important bug fix for us!

from pypulseq.

sravan953 avatar sravan953 commented on August 25, 2024

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.

sravan953 avatar sravan953 commented on August 25, 2024

Hello @KerstinHut , please let me know if things worked out alright?

from pypulseq.

KerstinKaspar avatar KerstinKaspar commented on August 25, 2024

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.

sravan953 avatar sravan953 commented on August 25, 2024

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.

KerstinKaspar avatar KerstinKaspar commented on August 25, 2024

Great, thank you!

from pypulseq.

schuenke avatar schuenke commented on August 25, 2024

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.

sravan953 avatar sravan953 commented on August 25, 2024

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.

sravan953 avatar sravan953 commented on August 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.