Closed finnlennartsson closed 1 year ago
Installed AMICO
pip install ipython
conda activate py38
pip install dmri-amico -U
Running Matlab from command line can be done like this
matlab -nodesktop -nosplash -r "clc; clear all; addpath(genpath('$HOME/Software/vistasoft')); STRUCTURAL=niftiRead('${T2N4}.nii.gz'); x=STRUCTURAL.dim(1); y=STRUCTURAL.dim(2); z=STRUCTURAL.dim(3); bigMat=zeros(x*y*z,4); for i=1:4; nii=niftiRead(sprintf('${T2N4}-Pmap-000%d.nii.gz',i)); bigMat(:,i)=nii.data(:); end; bigMat2=bigMat; for j=1:x*y*z; bigMat2(j,:)=bigMat(j,:)./sum(bigMat(j,:)); end; for k=1:4; nii=niftiRead(sprintf('${T2N4}-Pmap-000%d.nii.gz',k)); nii.data=reshape(bigMat2(:,k),[x y z]); niftiWrite(nii,sprintf('${T2N4}-normalized-Pmap-000%d.nii.gz',k)); end; exit"
https://github.com/finnlennartsson/kpum_noddi/blob/fcb31888c15ebe662da77da914419c8e4464b464/scripts/dmri_noddi.sh#L115
Make a command that runs NODDI matlab-script from the script