Comments (8)
After git clone dcm2bids
and reinstall, everything work. Thank you for your help!
from dcm2bids.
Hi @agriffa ,
The intendedFor
field needs an explicit path to the file from inside the sub-HPNC040
directory. Since your data contains ses-01
, the "full path" required by the intendedFor
field in your .json file is what your modified ("ses-01/func/sub-HPNC040_ses-01_task-rest7min_bold.nii.gz"). If your data did not contain a ses-01
, then the intendedFor
field would be "func/sub-HPNC040_ses-01_task-rest7min_bold.nii.gz".
One other thing. Are you sure that task-rest7min
is BIDS compliant? Usually when I see resting-state data, it's just task-rest
. But if you're not getting validation errors then I guess it's fine.
from dcm2bids.
Dear @dlevitas ,
Thank you very much for your answer!
I understand that the intendedFor
field requires the "full path".
My problem is that if I specify "intendedFor": 0
in my dcm2bids_config file, where the first series ('0') is the func acquisition, dcm2bids will write a wrong path in the .json file. The call
dcm2bids -d /path/to/dicom/files/ -p HPNC040 -s 01 -c /path/to/dcm2bids_config.json -o /bids/folder/
writes
"IntendedFor": "func/sub-HPNC040_ses-01_task-rest7min_bold.nii.gz"
instead of
"IntendedFor": "ses-01/func/sub-HPNC040_ses-01_task-rest7min_bold.nii.gz"
in the .json file associated to the fieldmap Nifti.
Is there a way to automatically get the prefix ses-01
in the .json file, while using "intendedFor": 0
in dcm2bids_config?
I don't get errors or warnings from the bids-validator when using task-rest7min
.
from dcm2bids.
Got it, sorry for the misunderstanding. Are you using the most current version of dcm2bids (2.1.4)? This was an issue in earlier versions, but in the newest version it should be resolved.
from dcm2bids.
Yes, I do have dcm2bids v2.1.4
pip install --upgrade dcm2bids
Requirement already up-to-date: dcm2bids in /anaconda3/lib/python3.7/site-packages (2.1.4)
I can try to git clone dcm2bids and reinstall.
from dcm2bids.
Thanks so much for opening this issue @agriffa. I couldn't get why I was getting this problem until I found your issue. After many attempts at validating my files, I found out that if someone pip install dcm2bids
, it seems that it doesn't come with the #52 patch even though it was merged a while ago. So I was always getting the "IntendedFor" error.
Maybe #81 should be reviewed/merged to make sure it doesn't happen?
To validate my hypothesis, I freshly installed dcm2bids on my local computer in a virtual env and looked into the structure.py to find the missing code.
Here's what I found: I couldn't find these last 2 lines from the master branch.
session = self.participant.session
opj(session, dataType, niiFile).replace("\\", "/"))
(dcm2bids) sam@FX:~/$: pip install dcm2bids
Collecting dcm2bids
Downloading dcm2bids-2.1.4-py2.py3-none-any.whl (28 kB)
Collecting future
Downloading future-0.18.2.tar.gz (829 kB)
|████████████████████████████████| 829 kB 3.4 MB/s
Using legacy setup.py install for future, since package 'wheel' is not installed.
Installing collected packages: future, dcm2bids
Running setup.py install for future ... done
Successfully installed dcm2bids-2.1.4 future-0.18.2
(dcm2bids) sam@FX:~$ grep "session" /home/sam/.pyenv/versions/dcm2bids/lib/python3.7/site-packages/dcm2bids/structure.py
session (str): Optional label of a session
def __init__(self, name, session=DEFAULT.session):
self._session = ""
self.session = session
def session(self):
A string 'ses-<session_label>'
return self._session
@session.setter
def session(self, session):
if session.strip() == "":
self._session = ""
elif session.startswith("ses-"):
self._session = session
self._session = "ses-" + session
'sub-<subject_label>/ses-<session_label>'
return opj(self.name, self.session)
'sub-<subject_label>_ses-<session_label>'
return self.name + "_" + self.session
""" Check if a session is set
return not self.session.strip() == DEFAULT.session
(dcm2bids) sam@FX:~$
from dcm2bids.
@SamGuay is still the case with v2.1.5 or #107 ?
from dcm2bids.
Just installed it in a fresh venv and it seems to be there!
return self.session.strip() != DEFAULT.session
session = self.participant.session
intendedValue.append(opj(session, dataType, niiFile).replace("\\", "/"))
from dcm2bids.
Related Issues (20)
- IntendedFor and Sources with only relative path to dataset root is now deprecated
- Two H1s in "How to use advanced configuration" prevent full TOC
- sidecar_changes doesn't support int / numerical objects
- Should this line be pointing to one of the sidecar files? HOT 2
- Typos in some files of the scaffold raise errors on the validator
- Creating several 3D images instead of a single 4D image. HOT 2
- New features or enh for next release
- post_op HOT 6
- Provide a Docker image that includes pydeface HOT 4
- [BUG] dcmbids binary
- Processing order issue ? ```"IntendedFor" No id found for 'IntendedFor' value 'XX'``` HOT 4
- KeyError: 'datatype' HOT 1
- TypeError in Acquisition.init() when running dcm2bids HOT 1
- `sidecar_changes` do not fetch all matches of the referenced description
- Error: Too many NIFTI images with the name HOT 1
- compKeys default for run numbering doesn't seem like a good one HOT 1
- Subprocess Error Assistance HOT 3
- Allowing for post_op command's output to be printed to stdout HOT 2
- Script removes task information from filenames. HOT 8
- bids validator not working properly HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dcm2bids.