From 903e227ac756284b4cd13564e3ae58a62a3ba04c Mon Sep 17 00:00:00 2001 From: Horea Christian Date: Mon, 10 Jul 2017 13:04:48 +0200 Subject: [PATCH] fixed imports and type-specific parsing --- samri/pipelines/fc.py | 2 +- samri/plotting/connectivity.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/samri/pipelines/fc.py b/samri/pipelines/fc.py index 338c86a2..c5e3bd59 100644 --- a/samri/pipelines/fc.py +++ b/samri/pipelines/fc.py @@ -4,7 +4,7 @@ from os import path, listdir, getcwd, remove -from nilearn.input_data import NiftiMasker +from nilearn.input_data import NiftiMasker, NiftiLabelsMasker from nilearn.connectome import ConnectivityMeasure from nipype.interfaces import fsl diff --git a/samri/plotting/connectivity.py b/samri/plotting/connectivity.py index f3199773..81ee71d2 100644 --- a/samri/plotting/connectivity.py +++ b/samri/plotting/connectivity.py @@ -1,4 +1,5 @@ import numpy as np +from os import path from matplotlib import pyplot as plt from numpy import genfromtxt import seaborn as sns @@ -25,7 +26,8 @@ def plot_connectivity_matrix(correlation_matrix, #TODO: fix labels in ascending order corresponding to intensity values labels = path.abspath(path.expanduser(labels)) - correlation_matrix = path.abspath(path.expanduser(correlation_matrix)) + if isinstance(correlation_matrix, str): + correlation_matrix = path.abspath(path.expanduser(correlation_matrix)) labels_np = genfromtxt(labels, delimiter=',', usecols = (1), dtype = 'str') correlation_matrix = genfromtxt(correlation_matrix, delimiter=',')