mrirecon / bart

BART: Toolbox for Computational Magnetic Resonance Imaging
https://mrirecon.github.io/bart/
BSD 3-Clause "New" or "Revised" License
291 stars 161 forks source link

twixread does not seem to work with recent raw Siemens data #288

Closed mjherold closed 2 years ago

mjherold commented 2 years ago

I have two raw datasets (saved with twixtool) from the same Prisma Fit scanner, with the more recent data set acquired with VE11E software. While the "twixread" function of BART does work with the older data set (VE11B), twixread fails with raw data set obtained with VE11E. In both cases the data were acquired with the same 3-plane localizer sequence.

cmr@cmr1:~/bart$ ./bart twixread -A /home/cmr/rawdat/meas_MID00331_FID30508_3PL_LOC.dat ~/test
WARN: BART version is not reproducible.
VD Header. MeasID: 331 FileID: 30508 Scans: 2
Patient: xxxxxxxxxxxxxxxxxxxxxxxxxx
Protocol: 3PL LOC
VD Header. MeasID: 331 FileID: 30508 Scans: 2
Patient: xxxxxxxxxxxxxxxxxxxxxxxxxx
Protocol: 3PL LOC
WARN: Wrong number of samples: 1 != 0.
WARN: Stopping.
cmr@cmr1:~/bart$ ./bart twixread -A /home/cmr/rawdat/meas_MID00540_FID284271_3PL_LOC.dat ~/test
WARN: BART version is not reproducible.
bart: src/twixread.c:78: siemens_meas_setup: Assertion `(0 < hdr->nscans) && (hdr->nscans < 30)' failed.
Aborted (core dumped)
cmr@cmr1:~/bart$

I am using BART version v0.7.00-526-g093559f-dirty. Tried this under Ubuntu, and Mac OS x. In both cases same issue. Is the twixread function in BART not compatible with raw data from VE11E?

thank you!

Michael

hcmh commented 2 years ago

Hi Michael,

could you try again with the commits I just pushed? They seem to work for our VE data. But you are right, previously, bart would not read newer Siemens data correctly.

Best regards, Christian

mjherold commented 2 years ago

Hi Christian:

Thank you very much for getting back about this problem!

It looks to me like the in include in read.h of the ismrm subfolder should say #include "ismrm/ismrmrd.h" instead of "ismrmrd/ismrmrd.h" or one can create a symbolic link named isrmrmrd pointing to ismrm. At least this got me further along the compilation chain. Also the .h files ismrmrd.h and export.h were missing. I copied them to the ismrm subfolder of ~/bart/src. But maybe this all led to the next problem...

When I try to compile bart with gcc-11 under OS X I (for x86_64 arch) get an error saying:

Undefined symbols for architecture x86_64:
  "_ismrm_read_encoding_limits", referenced from:
      _ismrm_read_dims in libismrm.a(read.o)
  "_nlop_tf_create", referenced from:
      _opt_reg_configure in libgrecon.a(optreg.o)
ld: symbol(s) not found for architecture x86_64
collect2: error: ld returned 1 exit status
make[1]: *** [bart] Error 1

I am probably doing something wrong here ... but I did not seem to have this problem with the previous version when I compiled under OS X.

Compilation under Ubuntu is in comparison smooth sailing, but it seems the problem got worse as I get core-dumps with all raw .dat files I try using the new version of bart.

cmr@cmr-gadgetron:~/bart_0.7$ ./bart version
WARN: BART version is not reproducible.
v0.7.00-526-g093559f-dirty
cmr@cmr-gadgetron:~/bart_0.7$ ./bart twixread ~/rawdat/meas_MID00331_FID30508_3PL_LOC.dat test
WARN: BART version is not reproducible.
VD Header. MeasID: 331 FileID: 30508 Scans: 2
Patient: xxxxxxxxxxxxxxxxxxxxxxxxxx
Protocol: 3PL LOC
WARN: Wrong number of samples: 1 != 0.
WARN: Stopping.
cmr@cmr-gadgetron:~/bart$ ./bart version
v0.7.00-529-g50905f7
cmr@cmr-gadgetron:~/bart$ ./bart twixread ~/rawdat/meas_MID00331_FID30508_3PL_LOC.dat test
VD/VE Header. MeasID: 331 FileID: 30508 Scans: 2
Patient: xxxxxxxxxxxxxxxxxxxxxxxxxx
Protocol: 3PL LOC
ERROR: Incorrect number of ADCs read! ADC count difference: 1 != 0!
Aborted (core dumped)

Any help would be much appreciated!

Thank you! and best regards,

Michael

jtamir commented 2 years ago

Hi Michael and Christian,

I was able to confirm this works for data from XA both on Linux and Mac, where the previous commit 093559fd385dd did not work correctly. Note I did not try to install ISMRMRD. I used gcc11 on Mac.

mjherold commented 2 years ago

Thank you Jon! Would you mind sharing your Makefile?

Thanks,

Michael

jtamir commented 2 years ago

For Mac using Macports, my Makefile is the same as https://github.com/mrirecon/bart/blob/master/Makefile I have the following local Makefile:

~/bart $ cat Makefile.local
PARALLEL=1
CC=gcc-mp-11

You might want to try make allclean followed by make

mjherold commented 2 years ago

Thank you Jon!

Just managed to compile bart under OS X.

Still get errors with .dat files acquired under VE11E on Siemens Aera and Siemens Prisma scanners.

PHS010803:bart mj847$ ./bart version
WARN: BART version is not reproducible.
v0.7.00-529-g50905f7-dirty
PHS010803:bart mj847$ ./bart twixread -A /Volumes/MICHAEL/meas_MID00310_FID287610_LOCALIZER.dat test
WARN: BART version is not reproducible.
Assertion failed: ((0 < hdr->nscans) && (hdr->nscans < 30)), function siemens_meas_setup, file src/twixread.c, line 79.
Abort trap: 6
PHS010803:bart mj847$ ./bart twixread -A /Volumes/MICHAEL/Aera_L1_June_2022/meas_MID07247_FID347202_3PL_LOC.dat test
WARN: BART version is not reproducible.
VD/VE Header. MeasID: 7247 FileID: 347202 Scans: 2
Patient: xxxxxxxxxxxxxxxxxxxxxxxxxx
Protocol: 3PL LOC
ERROR: Could not automatically determine dimensions, adc read error!
Abort trap: 6
mjherold commented 2 years ago

For reference I used "siemens_to_ismrmrd" to read the raw data file giving trouble with bart.

PHS010803:bart mj847$ siemens_to_ismrmrd -z 2 -f '/Users/mj847/Downloads/Siemens raw/meas_MID00186_FID30751_MOLLI_5_3_1.dat' test
Siemens file is: /Users/mj847/Downloads/Siemens raw/meas_MID00186_FID30751_MOLLI_5_3_1.dat
Output file not specified -- using /Users/mj847/Downloads/Siemens raw/meas_MID00186_FID30751_MOLLI_5_3_1.mrd
-----------------------------------------------------------------
Converting measurement 2 into file /Users/mj847/Downloads/Siemens raw/meas_MID00186_FID30751_MOLLI_5_3_1.mrd in group dataset
-----------------------------------------------------------------
Using parameter map: IsmrmrdParameterMap_Siemens.xml
This file contains 2 measurement(s).
VD line file detected.
Protocol name [1]: AdjCoilSens
Protocol name [2]: T1Map_MOLLI_5_3_1_for_pre_and_post_contrast
Number of parameter buffers: 6
Buffer Name: Config
Buffer Name: Dicom
Buffer Name: Meas
Buffer Name: MeasYaps
Buffer Name: Phoenix
Buffer Name: Spice
Trajectory is: 1
Failed to find YAPS.lFirstFourierPartition array
center_line = 67
center_partition = 0
Baseline: N4_VE11E_LATEST_20181129
Software version: syngo MR E11
Protocol name: T1Map_MOLLI_5_3_1_for_pre_and_post_contrast
Dwell time: 2200
Using parameter XSL: IsmrmrdParameterMap_Siemens.xsl
Study time: 13:08:54
Last scan reached...
PHS010803:bart mj847$ ./bart version
WARN: BART version is not reproducible.
v0.7.00-529-g50905f7-dirty
PHS010803:bart mj847$ ./bart twixread -A '/Users/mj847/Downloads/Siemens raw/meas_MID00186_FID30751_MOLLI_5_3_1.dat' test
WARN: BART version is not reproducible.
VD/VE Header. MeasID: 186 FileID: 30751 Scans: 2
Patient: xxxxxxxxxxxxxxxxxxxxxxxxx
Protocol: T1Map_MOLLI_5_3_1_for_pre_and_post_contrast
ERROR: Could not automatically determine dimensions, adc read error!
Abort trap: 6

As I managed to compile bart with ISMRM=1 I could first convert to ismrm format and then use that file with bart. I was still hoping to get the twixread function in bart to work with these files...

hcmh commented 2 years ago

Well, then it seems that there are still issues with the support for VE. Would it be possible to get access to a dataset that does not work? For example by e-Mail? If these are human data, maybe a phantom measurement would be more appropriate to share.

But with such a dataset I could try to iron out remaining bugs in twixread.

mjherold commented 2 years ago

Hi Christian:

Is there another email address to which I can send you the Dropbox file share link? I am not sure where these emails go and I don’t want the link to go public.

I have put two raw data sets into a Dropbox folder.

One issue with the twixread in bart may be that you do not specify the scan you want to read in. I saved the complete RAID file in Twix for each acquisition, and these typically contain two scans. The acquisition data are in the last (second) scan, while the first scan has “adjustment” data.

Maybe you have to save the data for the "last scan” (the k-space data from your acquisition without data data from adjustment scan) separately with the TWIX tool, which I think is possible? Or twixread is modified to (typically) skip over the first scan and just read the last scan?

In the siemens_to_ismrmrd command you specify the scan number, though you can also write all scans in the file to hdf5 files.

Thank you!

Michael

On Jun 23, 2022, at 11:02 AM, Christian Holme @.***> wrote:

Well, then it seems that there are still issues with the support for VE. Would it be possible to get access to a dataset that does not work? For example by e-Mail? If these are human data, maybe a phantom measurement would be more appropriate to share.

But with such a dataset I could try to iron out remaining bugs in twixread.

— Reply to this email directly, view it on GitHub https://github.com/mrirecon/bart/issues/288#issuecomment-1164522984, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQVJP4D2E5UKLHSRD42KOTVQR4BZANCNFSM5ZCRM6AA. You are receiving this because you authored the thread.

hcmh commented 2 years ago

Hi Michael,

Unfortunately, this is public. You could share the link to holme@tugraz.at , then I will take a look.

Best wishes, Christian

hcmh commented 2 years ago

Thank you for the data!

Now, twixread should be able to read those datasets. If you find others that do not work, please reopen this issue or raise a new one.

Best wishes, Christian

mjherold commented 2 years ago

Hi Christian: Thank you very much for your help with this!

Bart’s twixread does now seem to work with Siemens VE11E data acquired with cartesian sampling.

I will also try other trajectories and see how it goes!

Again, thank you for the help and rapid response!

Michael

On Jul 1, 2022, at 5:45 AM, Christian Holme @.***> wrote:

Thank you for the data!

Now, twixread should be able to read those datasets. If you find others that do not work, please reopen this issue or raise a new one.

Best wishes, Christian

— Reply to this email directly, view it on GitHub https://github.com/mrirecon/bart/issues/288#issuecomment-1172156166, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQVJP4NHWF5JEH2OILAQQTVR242NANCNFSM5ZCRM6AA. You are receiving this because you authored the thread.

mjherold commented 1 year ago

Hi Christian:

The data are from patient studies but the raw data were anonymized for export with the Twix tool on the scanner and no patient information is left.

I will create a shared folder and then get back.

Thanks,

Michael

On Jun 23, 2022, at 11:02 AM, Christian Holme @.***> wrote:

Well, then it seems that there are still issues with the support for VE. Would it be possible to get access to a dataset that does not work? For example by e-Mail? If these are human data, maybe a phantom measurement would be more appropriate to share.

But with such a dataset I could try to iron out remaining bugs in twixread.

— Reply to this email directly, view it on GitHub https://github.com/mrirecon/bart/issues/288#issuecomment-1164522984, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQVJP4D2E5UKLHSRD42KOTVQR4BZANCNFSM5ZCRM6AA. You are receiving this because you authored the thread.