imr-framework / pypulseq

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

'Sequence' object has no attribute 'gradient_waveforms' in Sequence.calculate_kspace #107

Closed fzimmermann89 closed 9 months ago

fzimmermann89 commented 1 year ago

Hi,

https://github.com/imr-framework/pypulseq/blob/a18e34f89bc1d9a4a30e467013be00a8f17a3439/pypulseq/Sequence/sequence.py#L214 results in 'Sequence' object has no attribute 'gradient_waveforms' as gradient_waveforms has been removed in https://github.com/imr-framework/pypulseq/commit/22fb57c2006208510d0fd573fc6757d71fbae4c8

Not sure why as I am not familiar with thecodebase and the commit message does not really explain it...

Cheers, Felix

sravan953 commented 1 year ago

Hello, can you share code to reproduce this bug?

fzimmermann89 commented 1 year ago

Yes, any call to calculate_kspace will cause the error. The minimal example is

import pypulseq as pp
pp.Sequence().calculate_kspace()
btasdelen commented 1 year ago

@sravan953 @fzimmermann89 I believe calculate_kspace is also non-functional in upstream Pulseq implementation. I am not sure why.

@sravan953 Was there a reason to remove gradient_waveforms function? There are still several cases where it is useful. We can also take it out from Sequence.m and put into another file, if complexity is the issue.

fzimmermann89 commented 1 year ago

..and is calculate_kspacePP a drop-in replacement for calculate_kspace?

Nevermind, even though the description is the same, calculate_kspacePP uses piecewise polynomials.

sravan953 commented 1 year ago

@bilal-tasdelen @fzimmermann89 calculate_kspacePP() is supposed to be the replacement for calculate_kspace(). Since gradient_waveforms() was only called by calculate_kspace(), I removed it!

fzimmermann89 commented 9 months ago

As https://pypulseq.readthedocs.io/en/master/pypulseq.Sequence.html#pypulseq.Sequence.sequence.Sequence.calculate_kspace calculate_kspace is still in the documentation, I would prefer to get this fixed again.

Sorry for dropping the ball here, but I did not use pypulseq for some time -- and today got hit again by the same issue.