cvnlab / nsdcode

Code related to analyzing the Natural Scenes Dataset
BSD 2-Clause "Simplified" License
30 stars 8 forks source link

error with examples_nsdmapdata.py #7

Closed ariaaay closed 4 years ago

ariaaay commented 4 years ago

I ran python examples_nsdmapdata.py and got the following error output.

data array passed
Traceback (most recent call last):
  File "examples_nsdmapdata.py", line 23, in <module>
    targetdata = nsd_mapdata(subjix,sourcespace,targetspace,sourcedata,interptype=interpmethod,badval=0, outputfile=f'test-{sourcespace}-{targetspace}-{interpmethod}.nii.gz')
  File "/home/yuanw3/nsdcode/python/mapdata/nsd_mapdata.py", line 239, in nsd_mapdata
    sourceclass = sourcedata.dtype
AttributeError: 'str' object has no attribute 'dtype'

The "sourcedata" is /path to NSD/nsddata/ppdata/subj01/anat/T1_0pt8_masked.nii.gz, which does exist.

Any ideas of what I did wrong?

iancharest commented 4 years ago

That's related with how I check if you pass a str or data array. I'll fix this tonight.

iancharest commented 4 years ago

this should be fixed now. let me know if you find other issues. thanks!