pypulseq icon indicating copy to clipboard operation
pypulseq copied to clipboard

`Sequence.install` functionality

Open FrankZijlstra opened this issue 1 year ago • 1 comments

This PR adds an implementation of the Sequence.install functionality as suggested in #163, with an interface that is very similar to Matlab Pulseq.

  • The Matlab Pulseq implementation for Siemens scanners is included
  • Custom scanner targets can be added using pypulseq.Sequence.install.register_scanner

The implementation is fairly straightforward, but I wonder if the install function should throw exceptions to give more detailed errors (e.g. stdout from the system command calls).

FrankZijlstra avatar Aug 15 '24 14:08 FrankZijlstra

Didn't find the time yet, but I will hopefully review it soon

schuenke avatar Aug 25 '24 08:08 schuenke

Hey. I finally went through the code. Sorry for the loooooooooong delay @FrankZijlstra

I never used the Sequence.install() option, but hopefully be able to give it a try on Monday. Regarding the code, I think making SequenceDefinition a real Abstract Base Class would make sense. But I could do that if you want.

schuenke avatar Nov 01 '24 10:11 schuenke

Yes, using the abstract base class makes sense. But since I never used it before, you are probably able to change it quicker than me. Having can_install default to True would be nice if possible, but it wouldn't be a big deal if that method is also abstract.

FrankZijlstra avatar Nov 01 '24 15:11 FrankZijlstra

I tried to test the feature at our scanner, but in our institute the scanner is in a separate network so I cannot access it from my computer.

The code in general looks good to me. Did you verify that it actually works as expected @FrankZijlstra? If you confirm it, I would be willing to approve it. Or does @btasdelen wanna give it a try?

schuenke avatar Nov 19 '24 07:11 schuenke

Yes, I did test it (twice I believe), but only on one scanner (running Numaris X, not Numaris 4). The installation worked fine. At this point I don't remember if the caching of the scanner detection worked properly. I remember that once it kept pinging the scanner on every install call, despite being the same ipython runtime (i.e. where the cache should work). But I don't recall whether or not I fixed it afterwards... Either way that would be minor issue, that could be resolved easily later when someone is able to test it more thoroughly.

FrankZijlstra avatar Nov 19 '24 16:11 FrankZijlstra

Our scanner is also on a separate network. The workflow we use to install is to upload the sequence to a known directory on a remote server. The scanner has access to the remote server, and we have a script to pull and install the .seq files on the scanner. Maybe I could register the remote server as a scanner? I don't know if it is a useful test, though.

btasdelen avatar Nov 20 '24 17:11 btasdelen