MICA-MNI / micapipe

micapipe from the Multimodal imaging and connectome analysis lab (http://mica-mni.github.io) at the Montreal Neurological Institute. Read The Docs documentation below
http://micapipe.readthedocs.io
GNU General Public License v3.0
86 stars 29 forks source link

-SC does not produce connectome text files #82

Closed araikes closed 1 year ago

araikes commented 1 year ago

singularity run --cleanenv -B /xdisk/adamraikes/cornell/nifti:/nifti:ro -B $PWD/derivatives:$PWD/derivatives -B /tmp:/tmp -B /groups/adamraikes/license.txt:/license.txt /groups/adamraikes/singularity_images/micapipe_v0.2.0.sif -bids /nifti -out $PWD/derivatives/micapipe -sub 087 -tmpDir /tmp -SC -tracts 20M -fs_licence /license.txt

rcruces commented 1 year ago

Hello, this is the expected behavior of the current version of the pipeline. We are storing the connectomes as GIFTI files because they use less storage and contain metadata about the creation. You can load the gifti files using different software like R, python of matlab. Below is an example with python:

import nibabel as nb
def load_sc(File):
    """Loads and process a structura connectome
    File is the path to the gifti file
    """

    # load the matrix
    mtx_sc = nb.load(File).darrays[0].data

    # Mirror the matrix
    mtx_sc = np.log(np.triu(mtx_sc,1)+mtx_sc.T)
    mtx_sc[np.isneginf(mtx_sc)] = 0

    # replace 0 values with almost 0
    SC[SC==0] = np.finfo(float).eps

    return SC
araikes commented 1 year ago

@rcruces

Documentation needs to be updated to reflect this. It currently still indicates that the outputs are text files. This is true for the DWI processing page (https://micapipe.readthedocs.io/en/latest/pages/02.dwiproc/index.html), the main output matrices page (https://micapipe.readthedocs.io/en/latest/pages/04.matrices/index.html), and the building gradients page (https://micapipe.readthedocs.io/en/latest/pages/04.gradients/index.html).

rcruces commented 1 year ago

Thanks for your observation. Indeed, we did the deployed earlier this week, and we are working on the documentation.