nipy / nipype

Workflows and interfaces for neuroimaging packages
https://nipype.readthedocs.org/en/latest/
Other
745 stars 529 forks source link

ecc_pipeline discrepency in intensities #1787

Closed salma1601 closed 6 years ago

salma1601 commented 7 years ago

Summary

ecc_pipeline change intensity range for non B0 scans

Actual behavior

I have a raw diffusion image with B0 scan intensities around 1000 and other scans around 200. After the ecc_pipeline, the B0 scan intensities have the same range while the other scans are between 0 and 1

Expected behavior

I expected the range of the scans to remain comparable to the raw image

How to replicate the behavior

from nipype.workflows.dmri.fsl.artifacts import ecc_pipeline 
ecc = ecc_pipeline()
ecc.inputs.input_node.in_file = '4d_dwi.nii.gz'
ecc.inputs.input_node.in_bval = 'bval'
ecc.inputs.input_node.in_mask = 'brain_mask.nii.gz'
ecc.run()

Platform details:

{'nibabel_version': '2.1.0', 'networkx_version': '1.11', 'numpy_version': '1.12.0', 'sys_platform': 'linux2', 'sys_version': '2.7.12 |Anaconda custom (64-bit)| (default, Jul 2 2016, 17:42:40) \n[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]', 'commit_source': 'installation', 'commit_hash': u'a4d1e07', 'pkg_path': '/home/salma/anaconda2/lib/python2.7/site-packages/nipype', 'sys_executable': '/home/salma/anaconda2/bin/python', 'traits_version': '4.6.0', 'scipy_version': '0.18.1'}

mmromero commented 6 years ago

I am having exactly the same problem.

Platform details: {'nibabel_version': '2.2.1', 'commit_hash': '%h', 'scipy_version': '1.0.0', 'sys_executable': '/Users/miguel/anaconda/bin/python', 'traits_version': '4.6.0', 'commit_source': 'archive substitution', 'networkx_version': '2.1', 'numpy_version': '1.14.0', 'nipype_version': '1.0.0', 'pkg_path': '/Users/miguel/anaconda/lib/python3.5/site-packages/nipype', 'sys_platform': 'darwin', 'sys_version': '3.5.4 | packaged by conda-forge | (default, Dec 18 2017, 06:40:48) \n[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)]'}

djarecka commented 6 years ago

@salma1601 , @mmromero any chance you can point me to some data files I can use to reproduce the issue?

mmromero commented 6 years ago

Hi @djarecka. I am just using a standard 4D volume. For what I saw, the problem comes from dwi_flirt, where each volume (including the b0s) is equalized for FLIRT, then the original b0s are merged to the equalized dwi causing the issue.

salma1601 commented 6 years ago

@djarecka From what I remember, the problem came from exposure.equalize_adapthist because I commented out this line https://github.com/nipy/nipype/blob/master/nipype/workflows/dmri/fsl/utils.py#L802 and the following one as a workaround for this error. I didn't go more in trying to debug