nipype
nipype copied to clipboard
Error when running nipype-tutorial container in VScode
Summary
Thanks for developing this amazing tool. I'm new to nipype and docker and trying to set the tutorial container up in Vscode, however, when I run the following code block, it gives me an error.
bet = BET()
bet.inputs.in_file = input_file
bet.inputs.out_file = "/output/T1w_nipype_bet.nii.gz"
res = bet.run

Actual behavior

Expected behavior
I'm expecting to get the code block to run suceessfully
How to replicate the behavior
- run the docker image in vscode
-
Attach to the docker container

-
select interpreter (I selected neuro)

-
Run

Script/Workflow details
import os
from os.path import abspath
from nipype import Workflow, Node, MapNode, Function
from nipype.interfaces.fsl import BET, IsotropicSmooth, ApplyMask
from nilearn.plotting import plot_anat
%matplotlib inline
import matplotlib.pyplot as plt
input_file = abspath("/data/ds000114/sub-01/ses-test/anat/sub-01_ses-test_T1w.nii.gz")
bet = BET()
bet.inputs.in_file = input_file
bet.inputs.out_file = "/output/T1w_nipype_bet.nii.gz"
res = bet.run()
Execution environment
- Container
Do you have FSL installed in the container?
Hi @effigies
I used docker pull miykael/nipype_tutorial:latest to get the docker image. So I suppose FSL should be already existed in the image?
Because when I run docker run -it --rm -p 8888:8888 miykael/nipype_tutorial jupyter notebook and open notebooks in my browser, it works fine. But if I do it in the vscode, there's an error.
Thanks in advance for the help!
It seems that there might be environment variables that aren't getting loaded, such as the PATH? FSL should be available in the container.
Unfortunately, I don't have any experience with using vscode inside a container. (And little enough outside.) But the problem does seem to be that the command can't be found.
Hi @effigies Thanks for the help! I decided to work in the original jupyter notebook. However, when I try to nount my local file by running this code in the tutorial
docker run -p 8888:8888 -it --rm -v /Users/yufang/Leelab/Fmri/Notebooks -v /Users/yufang/Leelab/Fmri/data -v /Users/yufang/Leelab/Fmri/output -v /Users/yufang/Leelab/Fmri/20220618_122133_1_anaesth_auditory_response_1_1 miykael/nipype_tutorial
My local files doesn't show up, the directory is still the same to the tutorial's directory and I have no idea how should I fix it
Thanks!
Sorry, I'm not really sure what the setup of the tutorial environment is. I would suggest Neurostars for more general questions, as this repository gets very limited views.