PennLINC / fw-heudiconv

Heuristic-based Data Curation on Flywheel
BSD 3-Clause "New" or "Revised" License
6 stars 11 forks source link

B0 magnitude image issue #15

Closed willtack closed 5 years ago

willtack commented 5 years ago

Hello,

I'm encountering an issue where both magnitude images get named _sub-01_ses-01magnitude2.nii.gz. I've tried distinguishing by TE in the heuristic and by changing the respective ProtocolName fields to B0map_e1 , B0map_e2 and distinguishing by that. What then happens is that both of the original mag niftis are converted to sub-01_ses-01_magnitude1.nii.gz and then to _magnitude2.nii.gz, like so:

DEBUG: 1.3.12.2.1107.5.2.43.167024.2019041120200325099367046.0.0.0_e1.nii.gz->sub-01/ses-01/fmap/sub-01_ses-01_magnitude1.nii.gz DEBUG: 1.3.12.2.1107.5.2.43.167024.2019041120200325099367046.0.0.0_e2.nii.gz->sub-01/ses-01/fmap/sub-01_ses-01_magnitude1.nii.gz DEBUG: 1.3.12.2.1107.5.2.43.167024.20190411202003250993 67046.0.0.0_e1.nii.gz->sub-01/ses-01/fmap/sub-01_ses-01_magnitude2.nii.gz DEBUG: 1.3.12.2.1107.5.2.43.167024.2019041120200325099367046.0.0.0_e2.nii.gz->sub-01/ses-01/fmap/sub-01_ses-01_magnitude2.nii.gz

Not sure if this is a bug or if I'm doing something wrong. Here is a relevant snippet of my heuristic. (Sorry about unclear spacing).

elif "b0map_e1" in protocol and "M" in s.image_type and s.TE == 0.00412: get_latest_series(b0_mag1,s) elif "b0map_e2" in protocol and "M" in s.image_type and s.TE == 0.00658: get_latest_series(b0_mag2,s)

TinasheMTapera commented 5 years ago

Hey Will,

Would you mind posting the full heuristic file here, so I can get an idea of the context with get_latest_series?

mattcieslak commented 5 years ago

Could you take a look at https://github.com/PennBBL/brainrf1/blob/master/brainrf1_heuristic.py? We have the fieldmaps working on this study, you just use '{item}' in the template. Also make sure to just append the series id instead of getting the latest one. Here's where we do it https://github.com/PennBBL/brainrf1/blob/master/brainrf1_heuristic.py#L114

willtack commented 5 years ago

Using {item} in the template did the trick! Thanks for the help--I never would have thought of that.

get_latest_series is interchangeable with info[key].append(s.series_id) a la https://github.com/PennBBL/fw-heudiconv/blob/master/grmpy_heuristic.py#L64 . But looking back, I suppose it's redundant sans commented lines.

On Tue, May 7, 2019 at 6:32 PM Matt Cieslak notifications@github.com wrote:

Could you take a look at https://github.com/PennBBL/brainrf1/blob/master/brainrf1_heuristic.py? We have the fieldmaps working on this study, you just use '{item}' in the template. Also make sure to just append the series id instead of getting the latest one. Here's where we do it https://github.com/PennBBL/brainrf1/blob/master/brainrf1_heuristic.py#L114

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/PennBBL/fw-heudiconv/issues/15#issuecomment-490278711, or mute the thread https://github.com/notifications/unsubscribe-auth/ALVSREV5FKVRUIV2AOBP7Y3PUH7RHANCNFSM4HLMXUJA .

mattcieslak commented 5 years ago

great! We currently have 0 documentation so please just post questions here as they come up.