Skip to content

Paradigm class: unexpected behavior if con_ids are strings #310

Closed
mekman opened this Issue Mar 6, 2014 · 3 comments

4 participants

@mekman
mekman commented Mar 6, 2014

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
@GaelVaroquaux
NIPY developers member
@bthirion bthirion referenced this issue Apr 8, 2014
Merged

Clean paradigm #316

@matthew-brett
NIPY developers member

Closed by #316

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.