Beispiel #1
0
def test_loadflat():
    alist = [dict(a='one', c='three', b='two'),
             dict(a='one', c='three', b='two')]
    fd, name = mkstemp(suffix='.npz')
    np.savez(name,a=alist)
    aloaded = loadflat(name)['a']
    os.unlink(name)
    yield assert_equal, len(aloaded), 2
    yield assert_equal, sorted(aloaded[0].items()), sorted(alist[0].items())
    adict = dict(a='one', c='three', b='two')
    fd, name = mkstemp(suffix='.npz')
    np.savez(name,a=adict)
    aloaded = loadflat(name)['a']
    os.unlink(name)
    yield assert_true, isinstance(aloaded, dict)
    yield assert_equal, sorted(aloaded.items()), sorted(adict.items())
Beispiel #2
0
 def _get_session_info(self, session_info_file):
     key = "session_info"
     data = loadflat(session_info_file)
     session_info = data[key]
     if isinstance(session_info, dict):
         session_info = [session_info]
     return session_info
Beispiel #3
0
def test_loadflat():
    alist = [
        dict(a='one', c='three', b='two'),
        dict(a='one', c='three', b='two')
    ]
    fd, name = mkstemp(suffix='.npz')
    np.savez(name, a=alist)
    aloaded = loadflat(name)['a']
    os.unlink(name)
    yield assert_equal, len(aloaded), 2
    yield assert_equal, sorted(aloaded[0].items()), sorted(alist[0].items())
    adict = dict(a='one', c='three', b='two')
    fd, name = mkstemp(suffix='.npz')
    np.savez(name, a=adict)
    aloaded = loadflat(name)['a']
    os.unlink(name)
    yield assert_true, isinstance(aloaded, dict)
    yield assert_equal, sorted(aloaded.items()), sorted(adict.items())
Beispiel #4
0
    def _list_outputs(self):
        outputs = self._outputs().get()
        if not hasattr(self, "sessinfo"):  # backwards compatibility
            data = loadflat(os.path.join(os.getcwd(), "%s_modelspec.npz" % self.inputs.subject_id))
            if isinstance(data["session_info"], dict):
                self.sessinfo = [data["session_info"]]
            else:
                self.sessinfo = data["session_info"]

        outputs["session_info"] = self.sessinfo

        return outputs
Beispiel #5
0
'''
Created on 8 Nov 2010

@author: filo
'''
from nipype.utils.filemanip import loadflat
from neuroutils import ThresholdGGMM

c = loadflat("/media/data/2010reliability/workdir/pipeline/line_bisection/model/threshold_topo_ggmm/_subject_id_20100929_16849/ggmm/crash-20101116-135736-filo-_ggmm2.npz")
n = c['node']
print n.inputs

ggmm = ThresholdGGMM(mask_file= n.inputs.mask_file, stat_image=n.inputs.stat_image)

ggmm.run()