Example #1
0
 def __init__(self, string_p, float_p, int_p, array_p, obj_p):
     Initable.__init__(self)
     self.string_p = string_p
     self.float_p = float_p
     self.int_p = int_p
     self.array_p = array_p
     self.obj_p = obj_p
Example #2
0
 def __init__(self, stim_onsets=unstack_trees(DEFAULT_ONSETS)[0],
              stim_durations=unstack_trees(DEFAULT_STIM_DURATIONS)[0],
              func_data_file=DEFAULT_BOLD):
     Initable.__init__(self)
     self.onsets = stim_onsets
     self.durations = stim_durations
     self.func_data_file = func_data_file
Example #3
0
    def __init__(self, geometry=MaskUI(), sessions_data=[SessionDataUI()],
                 tr=DEFAULT_TR):

        Initable.__init__(self)
        self.mask_ui = geometry
        self.sessions_data_ui = sessions_data
        self.tr = tr
        self.data_type = geometry.data_type
Example #4
0
    def __init__(self, data=FmriData(), analyser=Analyser(), info={},
                 l=[5,6]):
        Initable.__init__(self)

        self.data = data
        self.analyser = analyser
        self.info = info
        self.list = l
Example #5
0
    def __init__(self, data=FmriDataUI(), analyser=AnalyserUI(),
                 result_dump_file=None, output_dir=None):
        Initable.__init__(self)

        self.data_ui = data
        self.analyser_ui = analyser

        self.data = None
        self.analyser = None
Example #6
0
    def test_from_numpy1D(self):

        n = UiNode.from_py_object('n', np.arange(5))
        if 0:
            print 'n:'
            print n.log()

        o = Initable.from_ui_node(n)
        assert_array_equal(o, np.arange(5))
Example #7
0
    def test_from_ui_node_basic(self):
        d = Dummy('a', 1.3, 5, np.arange(5), Dummy2('rr'))
        root_node = d.to_ui_node('dummy')
        d2 = Initable.from_ui_node(root_node)

        self.assertEqual(d.string_p, d2.string_p)
        self.assertEqual(d.float_p, d2.float_p)
        self.assertEqual(d.int_p, d2.int_p)
        assert_array_equal(d.array_p, d2.array_p)
Example #8
0
    def test_from_numpy_scalar(self):

        a = np.float128(1.2)
        n = UiNode.from_py_object('a', a)
        if 0:
            print 'n:'
            print n.log()

        o = Initable.from_ui_node(n)
        self.assertEqual(o, a)
        self.assertEqual(o.dtype, a.dtype)
Example #9
0
    def test_from_numpyND(self):

        sh = (2,3,4,5)
        a = np.arange(np.prod(sh)).reshape(sh)
        n = UiNode.from_py_object('n', a)
        if 0:
            print 'n:'
            print n.log()

        o = Initable.from_ui_node(n)
        assert_array_equal(o, a)
Example #10
0
 def __init__(self, nb_iterations=1000, make_outputs=True):
     Initable.__init__(self)
     self.nb_iterations = nb_iterations
     self.make_outputs = make_outputs
Example #11
0
 def __init__(self, paradigm=np.arange(5).astype(int),
              func_file='./bold.nii'):
     Initable.__init__(self)
     self.paradigm = paradigm
     self.func_file = func_file
Example #12
0
 def __init__(self, d):
     Initable.__init__(self)
     self.d = d
Example #13
0
 def __init__(self):
     Initable.__init__(self)
Example #14
0
 def from_xml(self, xml):
     from pyhrf.sandbox.design_and_ui import UiNode
     return Initable.from_ui_node(UiNode.from_xml(xml))
Example #15
0
 def __init__(self, mask_file=DEFAULT_MASK, mesh_file=None,
              data_type='volume'):
     Initable.__init__(self)
     self.mask_file = mask_file
     self.mesh_file = mesh_file
     self.data_type = data_type
Example #16
0
 def __init__(self, p=3):
     Initable.__init__(self)
     self.p = p
Example #17
0
 def __init__(self, paradigm_file=DEFAULT_PARADIGM_CSV,
              func_data_files=[DEFAULT_BOLD]):
     Initable.__init__(self)
     self.paradigm_file = paradigm_file
     self.func_data_files = func_data_files