Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Paradigm class: unexpected behavior if con_ids are strings #310

Open
mekman opened this Issue · 2 comments

3 participants

@mekman

The following illustrates an unexpected effect when using the Paradigm class with condition names that are strings. The problem is in this line:
https://github.com/nipy/nipy/blob/master/nipy/modalities/fmri/experimental_paradigm.py#L51

from nipy.modalities.fmri.experimental_paradigm import BlockParadigm
onsets = np.array([0, 6])
durations = np.array([1, 1])
conditions = np.array(['001', '002'])

paradigm = BlockParadigm(conditions, onsets, durations, amplitude=None)
print paradigm.con_id

This yields the following:

array(['c1', 'c2'], 
      dtype='|S2')

this works fine

conditions = np.array(['C001', 'C002'])
paradigm = BlockParadigm(conditions, onsets, durations, amplitude=None)
print paradigm.con_id

array(['C001', 'C002'], 
      dtype='|S4')

The docstring suggests that con_id should be a string. Therefore I think one would expect the latter result for both cases.

Best,
Matthias

@bthirion
Collaborator
@GaelVaroquaux
Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.