Closed isabelannwingert closed 3 years ago
Hey @isabelannwingert sorry for the delay. I think the problem is that your heuristic is unpacking two items instead of one:
def infotodict(seqinfo):
"""Heuristic evaluator for determining which runs belong where
allowed template fields - follow python string module:
item: index within category
subject: participant id
seqitem: run number during scanning
subindex: sub index within group"""
info = { ac_dyn_av1451: [],
nac_dyn_av1451: [],
ac_stat_av1451: [],
nac_stat_av1451: [] }
for s in seqinfo:
protocol = s.protocol_name.lower()
if "DY_CTAC] AV1451 Brain Dynamic" in s.protocol_name:
info[ac_dyn_av1451].append(s.series_id)
elif "DY_NAC] AV1451 Brain Dynamic" in s.protocol_name:
info[nac_dyn_av1451].append(s.series_id)
elif "[BR_CTAC] AV1451 Brain Dynamic" in s.protocol_name:
info[ac_stat_av1451].append(s.series_id)
elif "[BR_NAC] AV1451 Brain Dynamic" in s.protocol_name:
info[nac_stat_av1451].append(s.series_id)
else:
print("Series not recognized!: ", protocol, s.dcm_dir_name)
return info, seqinfo #### THIS SHOULD ONLY RETURN <info>
Hi!
That didn't work, although no errors were raised.
I did get a message that the PET series I was trying to curate were not recognized.
Series not recognized!: brain-nac-2mm.xml BR_NAC AV1451 Brain Dynamic.nii.gz
Series not recognized!: brain-nac-2mm.xml BR_CTAC AV1451 Brain Dynamic.nii.gz
Series not recognized!: brain-nac-2mm.xml BR-DY_NAC AV1451 Brain Dynamic.nii.gz
Series not recognized!: brain-nac-2mm.xml BR-DY_CTAC AV1451 Brain Dynamic.nii.gz
Ok I looked at the seqinfo table you sent via email, I think you may be approaching this incorrectly. Here's a few problems:
First, you've assigned a variable protocol
that is supposed to be the protocol name in lowercase, and then you don't use it for your if statements:
for s in seqinfo:
protocol = s.protocol_name.lower()
if "DY_CTAC] AV1451 Brain Dynamic" in s.protocol_name:
info[ac_dyn_av1451].append(s.series_id)
Secondly, remember that the in
reserved word in Python is explicit for the range of data you search for. For example, 'oo' in 'foobar'
is true but 'oo a' in foobar
is false. Your use of in
in your conditionals is assuming that the string s.protocol_name
contains something like "foooo*****DY_CTAC] AV1451 Brain Dynamic******bar"
. I just don't think this is true, because s.protocol_name
cannot have spaces in it, and I doubt there are any protocols I've come across that use the bracket symbol.
Remember that s.protocol_name
comes straight out of the seqinfo table's protocol_name column, in which I didn't see any strings like the one you've used.
I think it would be helpful for you to review the tutorial and take another shot.
Hi Tinashe, the issue here has been resolved, and PET data can be curated now. However, there are a few bugs that I would like to raise that is related to this. I will continue on the discussion here later today with what happened during curation. Thanks!
Describe the issue Hello, I had a PET image that I am basing a heuristic off of to curate PET data in FlyWheel. It looks like from the log that the curation wasn't working because PET metainformation wasn't stored in
tabulate
. I've attached the log below and emailed the tabulate output from the entire project to Matt and Tinashe and Azeez. The subject tested was a PET subject, and I followed a BIDS proposal for curating PET data. (https://docs.google.com/document/d/1mqMLnxVdLwZjDd4ZiWFqjEAmOmfcModA_R535v3eQs0/edit#)Were you running
fw-heudiconv
locally or from Flywheel's GUI?If you ran it through the GUI, please paste the Job ID below:
Please paste your heuristic below:
Please paste any relevant output below LOG IS DOWN BELOW:
Add any additional context or information below