-
Notifications
You must be signed in to change notification settings - Fork 30
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
HCP Pipelines Improvements (ICAFIX, PostFix, RestingStateStats, TaskfMRIAnalysis, londitudinal/cross-sectional logic) #31
base: master
Are you sure you want to change the base?
Conversation
… within fieldmap json sidecars
…ndedFor field at time of execution
…d maps if they exist
…en fieldmap and func shim settings
… run ICA-FIX pipeline
…lved within BIDS structure
Add Longitudinal to Extend Stream
…lly placed files that needed modifying into separate directory named modified_files
…erly within run.py
…ame instead of fmritcs
…ally made /bids_dir and /output_dir directories so this can container will work on singularity.
…longitudinal data. This has been corrected.
…ave to think about lvl2_fsf for TaskfMRIAnalysis.
Thanks for sending the PR! Could you remove the Also could you remove the |
import numpy | ||
|
||
""" | ||
This script is designed to determine which field maps apply to discrete fMRI scans |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very similar to get_fieldmap
implemented in pybids https://github.com/INCF/pybids/tree/master/bids/grabbids#get-a-fieldmap-files-intended-for-a-given-map. Maybe we should use that one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. It has been a while since I looked at the get_fieldmap function implemented in pybids so perhaps it has changed, but doesn't the get_fieldmap function just retrieve the fieldmap in which the fmriname is within the "IntendedFor" field? I was under the impression that the "IntendedFor" field does not automatically generate through the BIDS conversion, thus it has to be added manually.
What am I missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. Maybe I misunderstood what your function does. If it's part of a conversion process this repo might not be the best place for it. Maybe it would be better to put it in pybids?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see why you may have been confused. The comments I provide I very unclear. Obviously I created them when I did not understand what the script was doing myself, and forgot to come through and change them. It is added the "IntendedFor" fields to the fmap json sidecars, so yes I suppose it has more to do with the BIDS conversion. I can propose incorporation to pybids, but perhaps as a catch-all let's leave IntendedFor..py as is for now.
I can certainly remove the .idea and TaskfMRIAnalysis folders. Is there a way that can be done without deleting it on my fork and resending the pull request (sorry this is my first pull request!)? |
You just need to delete it on the branch from this PR and puszh it to GitHub. The PR will update automatically. |
I'll also correct merge conflicts within Dockerfile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again for sending this. I would love to merge it, but there are a few outstanding issues.. I had a first pass of the code, but since your changes are so extensive it's hard to evaluate everything. Tip for future contributions: keep PRs small and focused on one feature :)
@@ -1 +1 @@ | |||
dev | |||
v0.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert this change - this file is automatically updated when we trigger a release on GitHub
ENV LD_LIBRARY_PATH=/usr/lib/fsl/5.0 | ||
ENV FSLTCLSH=/usr/bin/tclsh | ||
ENV FSLWISH=/usr/bin/wish | ||
ENV FSLOUTPUTTYPE=NIFTI_GZ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a reason for moving this here?
echo 'deb http://neuro.debian.net/debian trusty main'; \ | ||
echo 'deb http://neuro.debian.net/debian data main'; \ | ||
echo '#deb-src http://neuro.debian.net/debian-devel trusty main'; \ | ||
} > /etc/apt/sources.list.d/neurodebian.sources.list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you want to remove this? It's an important workaround for flaky key server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obviously I did not understand the purpose of this. Feel free to leave it in!
apt-key adv --recv-keys --keyserver hkp://pgp.mit.edu:80 0xA5D32F012649A5A9 && \ | ||
apt-get update && \ | ||
apt-get install -y fsl-core=5.0.9-4~nd14.04+1 | ||
curl -sSL http://neuro.debian.net/lists/trusty.us-ca.full >> /etc/apt/sources.list.d/neurodebian.sources.list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment above.
tar zxf MSMs.tar.gz && \ | ||
rm MSMs.tar.gz && \ | ||
mv MSM_HOCR_v1/Ubuntu /opt/HCP-Pipelines/MSMBinaries && \ | ||
rm -rf MSM_HOCR_v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for not installing MSM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason, let's go with your version.
|
||
COPY version /version | ||
COPY IntendedFor.py /IntendedFor.py | ||
COPY modified_files/fsl_sub /usr/lib/fsl/5.0/fsl_sub |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What changes are required to this file? It would be better to apply them via diff
COPY modified_files/PostFix.sh /opt/HCP-Pipelines/PostFix/PostFix.sh | ||
COPY modified_files/run_prepareICAs.sh /opt/HCP-Pipelines/PostFix/Compiled_prepareICAs/distrib/run_prepareICAs.sh | ||
COPY modified_files/RestingStateStats.sh /opt/HCP-Pipelines/RestingStateStats/RestingStateStats.sh | ||
COPY modified_files/run_RestingStateStats.sh /opt/HCP-Pipelines/RestingStateStats/Compiled_RestingStateStats/distrib/run_RestingStateStats.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to avoid departing from the original HCP Pipelines as much as possible. Why those files need to be replaced?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally I absolutely agree with you, however, I was required to make mods to the RestingStateStats and PostFix scripts because the paths to the matlab compiler runtime are hardcoded to paths that fall within WashU's server systems.
@@ -8,9 +8,13 @@ | |||
from subprocess import Popen, PIPE | |||
from shutil import rmtree | |||
import subprocess | |||
import nibabel as nip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will be confusing for a lot of people - why not nib
or nb
?
lowresmesh = 32 | ||
#change ownership of completed processing | ||
#change_owner ='chown -R `stat -c "%u:%g" ' + args.output_dir + '` ' + args.output_dir | ||
#os.system(change_owner) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove commented out code.
if "-" in enc_dir: | ||
SEPhaseNeg = fieldmap | ||
# before do anything else add IntendedFor field to fieldmap | ||
setup(os.path.join(args.bids_dir, "sub-"+subject_label)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modifying input dataset in place is a big red flag. This bahaviour will not be expected by users and can cause a lot of trouble. We actually recommend to pass bids_dir
as a read-only volume which would break this.
Handling of missing metadata (such as IntendedFor) should be done before running BIDS Apps.
Yes I am learning my lesson that PRs should be small. I will definitely create small PRs in the future. |
This pull request extends the existing bids apps HCP Pipeline by adding on ICAFIX, PostFix, and RestingStateStats.
The TaskfMRIAnalysis portion has been started but has yet to be completed.
Logic was added in order to account for a bids format that meets either a standard cross sectional format such as:
sub-01
anat
func
And also a longitudinal format:
sub-01
ses-01
anat
func
ses-02
anat
func