Skip to content
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

problem with 3d mouse brain extraction #62

Closed
esther1262 opened this issue Jul 17, 2023 · 4 comments
Closed

problem with 3d mouse brain extraction #62

esther1262 opened this issue Jul 17, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@esther1262
Copy link

What happened?

Hi, I followed the tutorial brainextraction_tutorial.ipynb and tried to extract the mouse brain from nii.gz. The image dimension is 256x256x156. I use spyder so I installed nirodents and niworkflows using pip.

from nirodents.workflows.brainextraction import init_rodent_brain_extraction_wf

tar_img = '/home/user/sar21.nii.gz'
wd = '/home/user'

# Minimal set up of workflow
be_wf = init_rodent_brain_extraction_wf(output_dir=wd)
be_wf.inputs.inputnode.in_files = [tar_img]

be_wf.run()

Afterwards, a whole bunch of errors traceback popped up.

What command did you use?

from nirodents.workflows.brainextraction import init_rodent_brain_extraction_wf

tar_img = '/home/user/sar21.nii.gz'
wd = '/home/user'

# Minimal set up of workflow
be_wf = init_rodent_brain_extraction_wf(output_dir=wd)
be_wf.inputs.inputnode.in_files = [tar_img]

be_wf.run()


### What version of the software are you running?

latest

### How are you running this software?

Local installation ("bare-metal")

### Is your data BIDS valid?

No

### Are you reusing any previously computed results?

No

### Please copy and paste any relevant log output.

```shell
be_wf.run()
230717-15:23:32,868 nipype.workflow INFO:
	 Workflow rodent_brain_extraction_wf settings: ['check', 'execution', 'logging', 'monitoring']
2023-07-17 15:23:32,868 - Workflow rodent_brain_extraction_wf settings: ['check', 'execution', 'logging', 'monitoring']
230717-15:23:32,881 nipype.workflow INFO:
	 Running serially.
2023-07-17 15:23:32,881 - Running serially.
230717-15:23:32,882 nipype.workflow INFO:
	 [Node] Setting-up "rodent_brain_extraction_wf.denoise" in "/tmp/tmprh1pu6j_/rodent_brain_extraction_wf/denoise".
2023-07-17 15:23:32,882 - [Node] Setting-up "rodent_brain_extraction_wf.denoise" in "/tmp/tmprh1pu6j_/rodent_brain_extraction_wf/denoise".
230717-15:23:32,884 nipype.workflow INFO:
	 [Node] Executing "denoise" <nirodents.interfaces.DenoiseImage>
2023-07-17 15:23:32,884 - [Node] Executing "denoise" <nirodents.interfaces.DenoiseImage>
230717-15:23:32,887 nipype.workflow INFO:
	 [Node] Finished "denoise", elapsed time 0.000369s.
2023-07-17 15:23:32,887 - [Node] Finished "denoise", elapsed time 0.000369s.
230717-15:23:32,888 nipype.workflow WARNING:
	 Storing result file without outputs
2023-07-17 15:23:32,888 - Storing result file without outputs
230717-15:23:32,889 nipype.workflow WARNING:
	 [Node] Error on "rodent_brain_extraction_wf.denoise" (/tmp/tmprh1pu6j_/rodent_brain_extraction_wf/denoise)
2023-07-17 15:23:32,889 - [Node] Error on "rodent_brain_extraction_wf.denoise" (/tmp/tmprh1pu6j_/rodent_brain_extraction_wf/denoise)
230717-15:23:32,891 nipype.workflow ERROR:
	 Node denoise failed to run on host tchadmin-ipp.
2023-07-17 15:23:32,891 - Node denoise failed to run on host tchadmin-ipp.
230717-15:23:32,891 nipype.workflow ERROR:
	 Saving crash info to /home/user/ crash-20230717-152332-user-denoise-5dc9d8f1-3d8a-4858-b5f1-3a1435de456b.pklz
Traceback (most recent call last):
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/plugins/linear.py", line 47, in run
    node.run(updatehash=updatehash)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node denoise.

Cmdline:
	DenoiseImage -d 3 -i /home/user/ET-281_SE_HTR_Avg_2_POST.nii.gz -n Gaussian -o ET-281_SE_HTR_Avg_2_POST_noise_corrected.nii.gz -s 1
Stdout:

Stderr:

Traceback:
	Traceback (most recent call last):
	  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 398, in run
	    runtime = self._run_interface(runtime)
	  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 753, in _run_interface
	    raise IOError(
	OSError: No command "DenoiseImage" found on host tchadmin-ipp. Please check that the corresponding package is installed.


2023-07-17 15:23:32,891 - Saving crash info to /home/user/ crash-20230717-152332-user-denoise-5dc9d8f1-3d8a-4858-b5f1-3a1435de456b.pklz
Traceback (most recent call last):
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/plugins/linear.py", line 47, in run
    node.run(updatehash=updatehash)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node denoise.

Cmdline:
	DenoiseImage -d 3 -i /home/user/ET-281_SE_HTR_Avg_2_POST.nii.gz -n Gaussian -o ET-281_SE_HTR_Avg_2_POST_noise_corrected.nii.gz -s 1
Stdout:

Stderr:

Traceback:
	Traceback (most recent call last):
	  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 398, in run
	    runtime = self._run_interface(runtime)
	  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 753, in _run_interface
	    raise IOError(
	OSError: No command "DenoiseImage" found on host tchadmin-ipp. Please check that the corresponding package is installed.


230717-15:23:32,893 nipype.workflow INFO:
	 [Node] Setting-up "rodent_brain_extraction_wf.bspline_grid" in "/tmp/tmppr1er8y6/rodent_brain_extraction_wf/bspline_grid".
2023-07-17 15:23:32,893 - [Node] Setting-up "rodent_brain_extraction_wf.bspline_grid" in "/tmp/tmppr1er8y6/rodent_brain_extraction_wf/bspline_grid".
230717-15:23:32,894 nipype.workflow INFO:
	 [Node] Executing "bspline_grid" <nipype.interfaces.utility.wrappers.Function>
2023-07-17 15:23:32,894 - [Node] Executing "bspline_grid" <nipype.interfaces.utility.wrappers.Function>
230717-15:23:32,897 nipype.workflow INFO:
	 [Node] Finished "bspline_grid", elapsed time 0.001363s.
2023-07-17 15:23:32,897 - [Node] Finished "bspline_grid", elapsed time 0.001363s.
230717-15:23:32,898 nipype.workflow INFO:
	 [Node] Setting-up "rodent_brain_extraction_wf.clip_tmpl" in "/tmp/tmpwmtg6tt4/rodent_brain_extraction_wf/clip_tmpl".
2023-07-17 15:23:32,898 - [Node] Setting-up "rodent_brain_extraction_wf.clip_tmpl" in "/tmp/tmpwmtg6tt4/rodent_brain_extraction_wf/clip_tmpl".
230717-15:23:32,900 nipype.workflow INFO:
	 [Node] Executing "clip_tmpl" <niworkflows.interfaces.nibabel.IntensityClip>
2023-07-17 15:23:32,900 - [Node] Executing "clip_tmpl" <niworkflows.interfaces.nibabel.IntensityClip>
230717-15:24:24,821 nipype.workflow INFO:
	 [Node] Finished "clip_tmpl", elapsed time 51.920209s.
2023-07-17 15:24:24,821 - [Node] Finished "clip_tmpl", elapsed time 51.920209s.
230717-15:24:24,824 nipype.workflow INFO:
	 [Node] Setting-up "rodent_brain_extraction_wf.res_tmpl" in "/tmp/tmph68ezma3/rodent_brain_extraction_wf/res_tmpl".
2023-07-17 15:24:24,824 - [Node] Setting-up "rodent_brain_extraction_wf.res_tmpl" in "/tmp/tmph68ezma3/rodent_brain_extraction_wf/res_tmpl".
230717-15:24:24,826 nipype.workflow INFO:
	 [Node] Executing "res_tmpl" <niworkflows.interfaces.images.RegridToZooms>
2023-07-17 15:24:24,826 - [Node] Executing "res_tmpl" <niworkflows.interfaces.images.RegridToZooms>
230717-15:24:29,376 nipype.workflow INFO:
	 [Node] Finished "res_tmpl", elapsed time 4.548509s.
2023-07-17 15:24:29,376 - [Node] Finished "res_tmpl", elapsed time 4.548509s.
230717-15:24:29,379 nipype.workflow INFO:
	 [Node] Setting-up "rodent_brain_extraction_wf.tmpl_sigma" in "/tmp/tmpn6fdjc60/rodent_brain_extraction_wf/tmpl_sigma".
2023-07-17 15:24:29,379 - [Node] Setting-up "rodent_brain_extraction_wf.tmpl_sigma" in "/tmp/tmpn6fdjc60/rodent_brain_extraction_wf/tmpl_sigma".
230717-15:24:29,381 nipype.workflow INFO:
	 [Node] Executing "tmpl_sigma" <nipype.interfaces.utility.wrappers.Function>
2023-07-17 15:24:29,381 - [Node] Executing "tmpl_sigma" <nipype.interfaces.utility.wrappers.Function>
230717-15:24:29,384 nipype.workflow INFO:
	 [Node] Finished "tmpl_sigma", elapsed time 0.001178s.
2023-07-17 15:24:29,384 - [Node] Finished "tmpl_sigma", elapsed time 0.001178s.
230717-15:24:29,386 nipype.workflow INFO:
	 [Node] Setting-up "rodent_brain_extraction_wf.hires_mask" in "/tmp/tmpo6_p6al2/rodent_brain_extraction_wf/hires_mask".
2023-07-17 15:24:29,386 - [Node] Setting-up "rodent_brain_extraction_wf.hires_mask" in "/tmp/tmpo6_p6al2/rodent_brain_extraction_wf/hires_mask".
230717-15:24:29,389 nipype.workflow INFO:
	 [Node] Executing "hires_mask" <niworkflows.interfaces.fixes.FixHeaderApplyTransforms>
2023-07-17 15:24:29,389 - [Node] Executing "hires_mask" <niworkflows.interfaces.fixes.FixHeaderApplyTransforms>
230717-15:24:29,393 nipype.workflow INFO:
	 [Node] Finished "hires_mask", elapsed time 0.000443s.
2023-07-17 15:24:29,393 - [Node] Finished "hires_mask", elapsed time 0.000443s.
230717-15:24:29,393 nipype.workflow WARNING:
	 Storing result file without outputs
2023-07-17 15:24:29,393 - Storing result file without outputs
230717-15:24:29,395 nipype.workflow WARNING:
	 [Node] Error on "rodent_brain_extraction_wf.hires_mask" (/tmp/tmpo6_p6al2/rodent_brain_extraction_wf/hires_mask)
2023-07-17 15:24:29,395 - [Node] Error on "rodent_brain_extraction_wf.hires_mask" (/tmp/tmpo6_p6al2/rodent_brain_extraction_wf/hires_mask)
230717-15:24:29,396 nipype.workflow ERROR:
	 Node hires_mask failed to run on host tchadmin-ipp.
2023-07-17 15:24:29,396 - Node hires_mask failed to run on host tchadmin-ipp.
230717-15:24:29,397 nipype.workflow ERROR:
	 Saving crash info to /home/user/ crash-20230717-152429-user-hires_mask-183fdd9f-045f-4bf4-8bf2-cb75235b22a5.pklz
Traceback (most recent call last):
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/plugins/linear.py", line 47, in run
    node.run(updatehash=updatehash)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node hires_mask.

Cmdline:
	antsApplyTransforms --default-value 0 --float 1 --input /home/user/.cache/templateflow/tpl-Fischer344/tpl-Fischer344_desc-BrainCerebellumExtraction_mask.nii.gz --interpolation Gaussian --output tpl-Fischer344_desc-BrainCerebellumExtraction_mask_trans.nii.gz --reference-image /tmp/tmph68ezma3/rodent_brain_extraction_wf/res_tmpl/clipped_regrid.nii.gz --transform identity
Stdout:

Stderr:

Traceback:
	Traceback (most recent call last):
	  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 398, in run
	    runtime = self._run_interface(runtime)
	  File "/home/user/anaconda3/lib/python3.9/site-packages/niworkflows/interfaces/fixes.py", line 64, in _run_interface
	    runtime = super(FixHeaderApplyTransforms, self)._run_interface(
	  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 753, in _run_interface
	    raise IOError(
	OSError: No command "antsApplyTransforms" found on host tchadmin-ipp. Please check that the corresponding package is installed.


2023-07-17 15:24:29,397 - Saving crash info to /home/user/ crash-20230717-152429-user-hires_mask-183fdd9f-045f-4bf4-8bf2-cb75235b22a5.pklz
Traceback (most recent call last):
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/plugins/linear.py", line 47, in run
    node.run(updatehash=updatehash)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node hires_mask.

Cmdline:
	antsApplyTransforms --default-value 0 --float 1 --input /home/user/.cache/templateflow/tpl-Fischer344/tpl-Fischer344_desc-BrainCerebellumExtraction_mask.nii.gz --interpolation Gaussian --output tpl-Fischer344_desc-BrainCerebellumExtraction_mask_trans.nii.gz --reference-image /tmp/tmph68ezma3/rodent_brain_extraction_wf/res_tmpl/clipped_regrid.nii.gz --transform identity
Stdout:

Stderr:

Traceback:
	Traceback (most recent call last):
	  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 398, in run
	    runtime = self._run_interface(runtime)
	  File "/home/user/anaconda3/lib/python3.9/site-packages/niworkflows/interfaces/fixes.py", line 64, in _run_interface
	    runtime = super(FixHeaderApplyTransforms, self)._run_interface(
	  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 753, in _run_interface
	    raise IOError(
	OSError: No command "antsApplyTransforms" found on host tchadmin-ipp. Please check that the corresponding package is installed.


230717-15:24:29,399 nipype.workflow INFO:
	 [Node] Setting-up "rodent_brain_extraction_wf.lap_tmpl" in "/tmp/tmp1mjh01qb/rodent_brain_extraction_wf/lap_tmpl".
2023-07-17 15:24:29,399 - [Node] Setting-up "rodent_brain_extraction_wf.lap_tmpl" in "/tmp/tmp1mjh01qb/rodent_brain_extraction_wf/lap_tmpl".
230717-15:24:29,402 nipype.workflow INFO:
	 [Node] Executing "lap_tmpl" <nipype.interfaces.ants.utils.ImageMath>
2023-07-17 15:24:29,402 - [Node] Executing "lap_tmpl" <nipype.interfaces.ants.utils.ImageMath>
230717-15:24:29,406 nipype.workflow INFO:
	 [Node] Finished "lap_tmpl", elapsed time 0.000533s.
2023-07-17 15:24:29,406 - [Node] Finished "lap_tmpl", elapsed time 0.000533s.
230717-15:24:29,406 nipype.workflow WARNING:
	 Storing result file without outputs
2023-07-17 15:24:29,406 - Storing result file without outputs
230717-15:24:29,407 nipype.workflow WARNING:
	 [Node] Error on "rodent_brain_extraction_wf.lap_tmpl" (/tmp/tmp1mjh01qb/rodent_brain_extraction_wf/lap_tmpl)
2023-07-17 15:24:29,407 - [Node] Error on "rodent_brain_extraction_wf.lap_tmpl" (/tmp/tmp1mjh01qb/rodent_brain_extraction_wf/lap_tmpl)
230717-15:24:29,409 nipype.workflow ERROR:
	 Node lap_tmpl failed to run on host tchadmin-ipp.
2023-07-17 15:24:29,409 - Node lap_tmpl failed to run on host tchadmin-ipp.
230717-15:24:29,410 nipype.workflow ERROR:
	 Saving crash info to /home/user/ crash-20230717-152429-user-lap_tmpl-0ebb0418-0dcf-4cac-b17d-a75f66436163.pklz
Traceback (most recent call last):
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/plugins/linear.py", line 47, in run
    node.run(updatehash=updatehash)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node lap_tmpl.

Cmdline:
	ImageMath 3 clipped_regrid_maths.nii.gz Laplacian /tmp/tmph68ezma3/rodent_brain_extraction_wf/res_tmpl/clipped_regrid.nii.gz 0.26674192939227725
Stdout:

Stderr:

Traceback:
	Traceback (most recent call last):
	  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 398, in run
	    runtime = self._run_interface(runtime)
	  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 753, in _run_interface
	    raise IOError(
	OSError: No command "ImageMath" found on host tchadmin-ipp. Please check that the corresponding package is installed.


2023-07-17 15:24:29,410 - Saving crash info to /home/user/ crash-20230717-152429-user-lap_tmpl-0ebb0418-0dcf-4cac-b17d-a75f66436163.pklz
Traceback (most recent call last):
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/plugins/linear.py", line 47, in run
    node.run(updatehash=updatehash)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)
  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)
nipype.pipeline.engine.nodes.NodeExecutionError: Exception raised while executing Node lap_tmpl.

Cmdline:
	ImageMath 3 clipped_regrid_maths.nii.gz Laplacian /tmp/tmph68ezma3/rodent_brain_extraction_wf/res_tmpl/clipped_regrid.nii.gz 0.26674192939227725
Stdout:

Stderr:

Traceback:
	Traceback (most recent call last):
	  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 398, in run
	    runtime = self._run_interface(runtime)
	  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 753, in _run_interface
	    raise IOError(
	OSError: No command "ImageMath" found on host tchadmin-ipp. Please check that the corresponding package is installed.


230717-15:24:29,412 nipype.workflow INFO:
	 ***********************************
2023-07-17 15:24:29,412 - ***********************************
230717-15:24:29,413 nipype.workflow ERROR:
	 could not run node: rodent_brain_extraction_wf.denoise
2023-07-17 15:24:29,413 - could not run node: rodent_brain_extraction_wf.denoise
230717-15:24:29,414 nipype.workflow INFO:
	 crashfile: /home/user/ crash-20230717-152332-user-denoise-5dc9d8f1-3d8a-4858-b5f1-3a1435de456b.pklz
2023-07-17 15:24:29,414 - crashfile: /home/user/ crash-20230717-152332-user-denoise-5dc9d8f1-3d8a-4858-b5f1-3a1435de456b.pklz
230717-15:24:29,415 nipype.workflow ERROR:
	 could not run node: rodent_brain_extraction_wf.hires_mask
2023-07-17 15:24:29,415 - could not run node: rodent_brain_extraction_wf.hires_mask
230717-15:24:29,416 nipype.workflow INFO:
	 crashfile: /home/user/ crash-20230717-152429-user-hires_mask-183fdd9f-045f-4bf4-8bf2-cb75235b22a5.pklz
2023-07-17 15:24:29,416 - crashfile: /home/user/ crash-20230717-152429-user-hires_mask-183fdd9f-045f-4bf4-8bf2-cb75235b22a5.pklz
230717-15:24:29,416 nipype.workflow ERROR:
	 could not run node: rodent_brain_extraction_wf.lap_tmpl
2023-07-17 15:24:29,416 - could not run node: rodent_brain_extraction_wf.lap_tmpl
230717-15:24:29,418 nipype.workflow INFO:
	 crashfile: /home/user/ crash-20230717-152429-user-lap_tmpl-0ebb0418-0dcf-4cac-b17d-a75f66436163.pklz
2023-07-17 15:24:29,418 - crashfile: /home/user/ crash-20230717-152429-user-lap_tmpl-0ebb0418-0dcf-4cac-b17d-a75f66436163.pklz
230717-15:24:29,418 nipype.workflow INFO:
	 ***********************************
2023-07-17 15:24:29,418 - ***********************************
Traceback (most recent call last):

  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/plugins/linear.py", line 47, in run
    node.run(updatehash=updatehash)

  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 527, in run
    result = self._run_interface(execute=True)

  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 645, in _run_interface
    return self._run_command(execute)

  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/nodes.py", line 771, in _run_command
    raise NodeExecutionError(msg)

NodeExecutionError: Exception raised while executing Node denoise.

Cmdline:
	DenoiseImage -d 3 -i /home/user/sar21.nii.gz -n Gaussian -o ET-281_SE_HTR_Avg_2_POST_noise_corrected.nii.gz -s 1
Stdout:

Stderr:

Traceback:
	Traceback (most recent call last):
	  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 398, in run
	    runtime = self._run_interface(runtime)
	  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/interfaces/base/core.py", line 753, in _run_interface
	    raise IOError(
	OSError: No command "DenoiseImage" found on host tchadmin-ipp. Please check that the corresponding package is installed.



The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "/tmp/ipykernel_949068/2944723609.py", line 13, in <module>
    be_wf.run()

  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/engine/workflows.py", line 638, in run
    runner.run(execgraph, updatehash=updatehash, config=self.config)

  File "/home/user/anaconda3/lib/python3.9/site-packages/nipype/pipeline/plugins/linear.py", line 82, in run
    raise error from cause

RuntimeError: 3 raised. Re-raising first.

Additional information / screenshots

No response

@esther1262 esther1262 added the bug Something isn't working label Jul 17, 2023
@eilidhmacnicol
Copy link
Collaborator

Thanks for letting us know. It seems to me that nipype is having trouble accessing your local ants installation (because it is all ants tools that are throwing errors). Can you confirm what the output of the following command is?

python -c "import os; os.system(os.path.join(os.getenv('ANTSPATH'),'antsRegistration') + ' --version')"

@eilidhmacnicol
Copy link
Collaborator

It is also worth noting that the default for init_rodent_brain_extraction_wf() includes a rat template. It is unlikely you will get satisfactory results for mouse brain extraction using this template, but if you'd like to help us improve it, we would welcome your contributions.

@esther1262
Copy link
Author

os.getenv('ANTSPATH') outputs nothing. I have no problem usingants.image_read and ants.registration from package ants though.

@eilidhmacnicol
Copy link
Collaborator

This is a problem with the computing environment, not a NiRodents bug.

os.getenv('ANTSPATH') returning nothing suggests it is not set up for the underlying shell. artsBrainExtraction is a Nipype workflow; Nipype wraps various command line tools so they can be used together in a Python script and so still requires that the underlying dependencies are installed.

I've never used AntsPy but I guess that it does not require the bash command line and works natively in Python, and so it is incompatible with Nipype.

Although other NiPreps tools have considered replacing Nipype with AntsPy (nipreps/eddymotion#89), this is not something I would consider an urgent priority.

To fix, install ants locally or try building a docker image from the provided Dockerfile which should create an environment with the correct dependencies.

Feel free to reopen/open another issue if this does not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants