-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wishlist: TotalReadoutTime for sidecar BIDS .json #98
Comments
Can you provide a sample modern DICOM and a recipe for how you compute this using only the DICOM and CSA headers? I think the links you provide are obsolete (as well as this) as modern Siemens scans no longer seem to create the private tag 0019,1028. I note that dicm2nii attempts to compute this value by reading the dreaded ASCII portion of the CSA header, which I would really rather not do (for both performance and reliability reasons). In addition, with my own recent images, the values generated by dicm2nii do not look plausible. I now use TOPUP, so have not done the FUGUE undistortion for years. However, my recollection was that this value was used simply to save the unwrapped fieldmap estimate in calibrated units, and had no influence on the actual deformations estimated or applied. I do not know of a reliable way to extract this information from modern Siemens DICOM images. Looking at the available tools I think the method for determining this has changed with different software versions, so even if we have a solution that works for one software version (D13), I am not convinced it would work for prior (B17) or more recent (E11) tools. Therefore, I think one would need to go through an archive of old datasets to work out how the recipe has changed. Indeed, since we have to rely on private tags, any software we create may prove brittle and generate bogus values for future releases. The situation appears simpler for Philips, though I do not have example datasets. In brief, this is not a standard DICOM property, and the private vendor specific methods for inferring this value appear to have changed over time. Therefore, computation of this value does not seem to be a task for the DICOM to NIfTI stage (as it is not part of the DICOM standard). @chrisfilo (BIDS maintainer for dcm2niix) may want to comment, but I assume the intention is that this value is provided by the physicist rather than extracted from the DICOM data. Further, if my hunch is correct that this only changes the absolute values (which are scaled based on the data) such that it does not impact the unwarping, I would presume this is an optional field. |
If this value can be automatically extracted by the dcm2niix converter this
would be much more convenient and (potentially) less error prone that
getting it from the local MR physicist.
This field is not mandatory in BIDS, but since it's necessary if you are
planning to use FSL TOPUP to do susceptibility distortion correction we
highly recommend including it.
…On Wed, May 3, 2017 at 1:01 AM, Chris Rorden ***@***.***> wrote:
Can you provide a sample modern DICOM and a recipe for how you compute
this using only the DICOM and CSA headers? I think the links you provide
are obsolete (as well as this
<https://groups.google.com/forum/#!topic/7t_trt/fDR35kgU4mU>) as modern
Siemens scans no longer seem to create the private tag 0019,1028. I note
that dicm2nii attempts to compute this value by reading the dreaded ASCII
portion of the CSA header, which I would really rather not do (for both
performance and reliability reasons). In addition, with my own recent
images, the values generated by dicm2nii do not look plausible. I now use
TOPUP, so have not done the FUGUE undistortion for years. However, my
recollection was that this value was used simply to save the unwrapped
fieldmap estimate in calibrated units, and had no influence on the actual
deformations estimated or applied.
I do not know of a reliable way to extract this information from modern
Siemens DICOM images. Looking at the available tools I think the method for
determining this has changed with different software versions, so even if
we have a solution that works for one software version (D13), I am not
convinced it would work for prior (B17) or more recent (E11) tools.
Therefore, I think one would need to go through an archive of old datasets
to work out how the recipe has changed. Indeed, since we have to rely on
private tags, any software we create may prove brittle and generate bogus
values for future releases.
The situation appears simpler for Philips
<https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=fsl;162ab1a3.1308>,
though I do not have example datasets.
In brief, this is not a standard DICOM property, and the private vendor
specific methods for inferring this value appear to have changed over time.
Therefore, computation of this value does not seem to be a task for the
DICOM to NIfTI stage (as it is not part of the DICOM standard). @chrisfilo
<https://github.com/chrisfilo> (BIDS maintainer for dcm2niix) may want to
comment, but I assume the intention is that this value is provided by the
physicist rather than extracted from the DICOM data. Further, if my hunch
is correct that this only changes the absolute values (which are scaled
based on the data) such that it does not impact the unwarping, I would
presume this is an optional field.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOkp4dKmUvp18YjZec5aFv6OxIWfXgbks5r2DRqgaJpZM4NOkcc>
.
|
@chrisfilo |
|
As I noted earlier, the information from lcni is obsolete, as recent Siemens DICOMs do not generate the tag 0019, 1028. |
Isn't the TotalReadoutTime in EPI equal to the EchoTrainLength (0018,0091)? This parameter should already take PF and Parallel Imaging into account. |
No, ETL is "Number of lines in k-space acquired per excitation per image", and does not tell you how long it took to acquire those lines. While it is part of the equation, it is not the whole one, and we do need to validate that partial fourier and in plane parallel imaging (SENSE/GRAPPA) are taken into account. I do think someone needs to rigorously investigate this with sample datasets, and hopefully find a robust solution that can be used across vendors and across software updates. n.b. For future reference, in practice Siemens EPI scans always record the ETL as 1, so you should look at EPI factor. http://mriquestions.com/echo-planar-imaging.html |
You are right. The TotalReadoutTime would be the EchoSpacing * ETL. Interestingly enough, the EchoSpacing is given on the parameter card when setting up the sequence, but isn't written to the DICOM. |
@dangom - for completeness the FSL (and therefore BIDS) definition is |
I'm also trying to tackle this issue at the moment, since I'm building
(with the latter in microseconds — thanks @jmtyszka for the correction!), and this is what I have relied on in the past. I don't know how stable this has been/will be across software versions, though. |
@jonclayden - these fields are from the Series Shadow Data within the Siemens CSA header of the DICOM file. There's a documentation attempt here: http://gdcm.sourceforge.net/wiki/index.php/Gdcmdump#SIEMENS_CSA_Header, but the lEchoSpacing field doesn't appear in the GDCM dictionary and could be a D13 addition. If you're using product EPI sequences, the EPIFactor and EchoSpacing fields might be stable during that software version (D13), but there's no guarantee they won't change in the future. [Minor point: lEchoSpacing is in microseconds, not milliseconds] |
@jmtyszka, Yyou can get some archival Siemens EPI data here. In any case, surveying those archival files it does look like we can find something there... the B13 image was acquired in 2007. B12 (ep2d_bold) field does not exist |
Thanks Chris! Very cool that you still have a stash of older VB DICOMs and I agree, the CSA header can be a bit like the shifting sands of the Sahara. I have to look a bit deeper at how these fields are populated by a Siemens sequence, particularly whether it's consistent between product and 3rd party sequences like the CMRR multiband package and some of the Siemens WIP releases. Will update when I have a chance. |
I have just uploaded some new code that attempts to extract data from the ASCII portion of the CSA header. Unlike @jonclayden, neither of the two D13 systems I have data from provide EchoSpacing in this field (perhaps sequence differences - we use the CMRR multiband sequences). If successful, the software populates the BIDS with the following values Note that since scanning ASCII data is slow the new code is only invoked for Siemens data, with a CSA Series Header and where the ScanningSequence is "EP" (EPI), and only once for each series. @jmtyszka - I do have a deeper concern with peaking into the CSA header. At one stage (hopefully now fixed) Siemens did not zero-pad the binary portions of the CSA header, and this meant that random data from previous images could appear in the CSA portions. This makes scanning the CSA for ASCII treacherous, as your key words can get randomly intermixed with real data. I will try to refine my code later to skip the binary portions, but it does lead to ugly and hard to maintain code. |
Thanks, Chris! This does indeed pull out all three values from my test data. I'll poke around with some other data when I get a chance. |
I have just added a small update to restore Windows compatibility and to restrict the key searching to the ASCII portion of the series header (to avoid the known issue that the uninitialized bytes in the BINARY portion often include fragments from prior ASCII data). Unfortunately, this work confirms my earlier suspicion that the needed information is often not stored in the DICOM images, and one needs to sit down on the console to determine TotalReadoutTime. Unless someone else has insight, I will close this issue. |
I think the latest release (v1.0.20170609) solves this. I would appreciate if all of you (@yarikoptic, @chrisfilo, @jonclayden, @jmtyszka and @dangom) could test out the latest release. I got some help from Edward J. Auerbach (Center for Magnetic Resonance Research), though I take credit for any errors. In particular, for the "FSL" definition of TotalReadoutDuration we need to deal with the fence post issue. So if you have 90 reconstructed lines with AccelFactPE = 2, we need to know the time when we started to acquire the 88th line (as the 89th was interpolated). EffectiveEchoSpacing = 1.0 / (BandwidthPerPixelPhaseEncode * PhaseEncodingLines) TotalReadoutDuration = EffectiveEchoSpacing * (NumberOfPhaseEncodingSteps - AccelFactPE) TrueEchoSpacing = EffectiveEchoSpacing * AccelFactPE CSAImageHeader has the tag named "BandwidthPerPixelPhaseEncode" I no longer need to read data from the dreaded ASCII portion of the CSASeriesHeader, so that troublesome code is no longer used. This means the superfluous JSON tags "EchoSpacing", "EchoTrainDuration", and "EPIFactor" are not created. If anyone does want these tags, you can compile the software with the |
Thanks for putting so much effort into getting this right. It's very much appreciated. One things that I am concern with is the change of the name from |
@chrisfilo - I will change this to the BIDS name once I get feedback that this is the correct solution across sequences, versions, etc. At the moment, it LOOKS like the right solution to me, but I have only tested it on a tiny subset of images. Once the code gets validated, we can change the name and distribute via NITRC (as part of the MRIcroGL package). |
Excellent - thanks!
…On Sun, Jun 11, 2017 at 10:31 AM, Chris Rorden ***@***.***> wrote:
@chrisfilo <https://github.com/chrisfilo> - I will change this to the
BIDS name once I get feedback that this is the correct solution across
sequences, versions, etc. At the moment, it LOOKS like the right solution
to me, but I have only tested it on a tiny subset of images. Once the code
gets validated, we can change the name and distribute via NITRC (as part of
the MRIcroGL package).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#98 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAOkpy5gHnZWivbVzf1h5w7-sd_mpx2sks5sDCRkgaJpZM4NOkcc>
.
|
fwiw, I intend to test on some test sequences we collected for this one, but didn't have a chance yet and the local physicist, who could verify, just became a father again... So might take a few more days |
I tested with three in-plane accelerated datasets (from a Siemens VD13D Prisma) with the following specs: Echo Spacing 0.58ms rBW 2204 Hz/px All tests passed. |
The latest release now creates |
The validator is an excellent idea!
…On Wed, Jun 21, 2017 at 9:45 AM, Chris Rorden ***@***.***> wrote:
Closed #98 <#98>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#98 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAOkpyM0o9XHVtdSu1cV7xypIUVMcxpsks5sGR5pgaJpZM4NOkcc>
.
|
See issue #130 for relevant updates to this issue, including nuances regarding the calculation of EffectiveEchoSpacing and TotalReadoutTime when using Phase Resolution < 100% and/or Interpolation. |
BIDS 1.0.1 added
TotalReadoutTime: defined as the time (in seconds) from the center of the first echo to the center of the last echo (aka “FSL definition” - see here and here how to calculate it). This parameter is required if a corresponding multiple phase encoding directions fieldmap (see 8.9.4) data is present.
I wondered how life would be better if sidecar file had it automagically computed for me and BIDS validator shut itself up ;)
The text was updated successfully, but these errors were encountered: