<commit_before># -*- coding: utf-8 -*-
"""
Spyder Editor

get info about haxby data for classification/MVPA analysis

"""

import os
import numpy

class HaxbyData:

    def __init__(self,datadir):
        self.tr=2.5

        self.boldfile=os.path.join(datadir,'bold.nii.gz')
        self.boldbrainfile=os.path.join(datadir,'bold_brain.nii.gz')
        self.vtmaskfile=os.path.join(datadir,'mask4_vt.nii.gz')
        self.brainmaskfile=os.path.join(datadir,'bold_brain_mask.nii.gz')

        # load the event info
        labelfile=os.path.join(datadir,'labels.txt')
        lines=open(labelfile).readlines()
        lines=lines[1:] # drop header
        

        # find all block onsets
        self.conditions=[]
        self.condnums=[]
        self.onsets=[]
        self.durations=[]
        self.runs=[]
        cond=''
        
        self.cond_dict={'scissors':1,
         'face':2,
         'cat':3,
         'shoe':4,
         'house':5,
         'scrambledpix':6,
         'bottle':7,
         'chair':8}<commit_msg>updated to work with nilearn getter<commit_after># -*- coding: utf-8 -*-
"""
Spyder Editor

get info about haxby data for classification/MVPA analysis

"""

import os
import numpy

class HaxbyData:

    def __init__(self,datadir):
        self.tr=2.5
        
        self.boldfile=os.path.join(datadir,'bold.nii.gz')
        self.boldbrainfile=os.path.join(datadir,'bold_brain.nii.gz')
        self.vtmaskfile=os.path.join(datadir,'mask4_vt.nii.gz')
        self.brainmaskfile=os.path.join(datadir,'bold_brain_mask.nii.gz')

        # load the event info
        labelfile=os.path.join(datadir,'labels.txt')
        lines=open(labelfile).readlines()
        lines=lines[1:] # drop header
        

        # find all block onsets
        self.conditions=[]
        self.condnums=[]
        self.onsets=[]
        self.durations=[]
        self.runs=[]
        cond=''
        
        self.cond_dict={'scissors':1,
         'face':2,
         'cat':3,
         'shoe':4,
         'house':5,
         'scrambledpix':6,
         'bottle':7,
         'chair':8}
{'fraction_non_alphanumeric': 0.1446360153256705, 'fraction_numerical': 0.012452107279693486, 'mean_word_length': 2.1366366366366365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6482050', 'n_tokens_mistral': 754, 'n_tokens_neox': 729, 'n_words': 110}