PennLINC / fw-heudiconv

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

discriminate based on dimensions #25

Closed willtack closed 5 years ago

willtack commented 5 years ago

Hi,

I'm trying to discriminate between two sequences where the only difference is in the image dimensions, which I can see in the seqinfo tsv file. However, I'm encountering this error:

INFO: Loading heuristic file... INFO: Applying heuristic to query results... Traceback (most recent call last): File "./fw_heudiconv_run.py", line 69, in curate.convert_to_bids(fw, project_label, heuristic, subjects, sessions, dry_run=dry_run) File "/flywheel/v0/fw_heudiconv/cli/curate.py", line 86, in convert_to_bids to_rename = heuristic.infotodict(seq_infos) File "/flywheel/v0/input/heuristic/presurgicalEpilepsy_heuristic_5.py", line 96, in infotodict if dim3==612: NameError: name 'dim3' is not defined

Attaching the seq info file. I'm trying to discriminate between an ASL sequence and its corresponding M0 scan. The dcm2niix conversion seems messy because there are two separate nifti files for the M0. I'll poke around to see if that might be the more fundamental issue, because the conversion goes fine outside of Flywheel.

presurgicalEpilepsy_SeqInfo.xlsx

FYI I accidentally posted an empty issue a few minutes ago; sorry about that.

TinasheMTapera commented 5 years ago

Could you send the heuristic? It might be a python syntax thing

willtack commented 5 years ago

presurgicalEpilepsy_heuristic.txt

FWIW, the ideal way to decide would be with the number of timepoints (aka dim4) but that is listed as -1 for all sequences in the tsv?

TinasheMTapera commented 5 years ago

~You gotta wrap your dim3's in quotes, otherwise they're interpreted as variables (which you haven't set).~

# if dim3==612: # nope
if s.dim3==612:
willtack commented 5 years ago

Right, okay. My bad. Thanks!

Re: dim4 what do you think might be going on there?

mattcieslak commented 5 years ago

Are you sure, @TinasheMTapera? I don't think "dim3"==612 will ever be true. I think you want to check if s.dim3 == 612. dim4 is a known problem with flywheel (see #8), we're waiting to hear from them for a solution.

TinasheMTapera commented 5 years ago

@mattcieslak is right, I spoke too soon

willtack commented 5 years ago

Got it. Thanks all!