Example #1
0
    def fill_first_level(self):
        input_value=self.get_value("feat_files(1)")
        if input_value:
            self.input_file=self.strip_root(input_value)
            preproc_match=re.search("preproc.*feat",input_value)
            #TODO inconsistent methodology here
            if preproc_match:
                self.preproc=input_value[preproc_match.start():preproc_match.end()]

        number_of_evs=int(self.get_value("evs_orig"))
        number_of_copes=int(self.get_value("ncon_orig"))
        design_matrix=[['0' for col in range(number_of_evs+2)] for row in range(number_of_copes+1)]
        design_matrix[0][0]="Cope #"
        design_matrix[0][1]="Cope Name"
        self.evs=dict()
        self.cons=dict()
        for ind in range(1,number_of_evs+1):
            index=str(ind)
            ev_1=ev()
            ev_1.name=self.get_value("evtitle"+index)
            ev_1.file_path=self.get_value("custom"+index)
            ev_1.set_convolution(self.get_value("convolve"+index))
            ev_1.temporal_deriv=binary_value_to_yes_no(self.get_value("deriv_yn"+index))
            ev_1.temporal_filtering=binary_value_to_yes_no(self.get_value("tempfilt_yn"+index))
            design_matrix[0][ind+1]=ev_1.name
            self.evs[index]=ev_1

        for ind in range(1,number_of_copes+1):
            index=str(ind)
            con=contrast()
            con.name=self.get_value("conname_orig."+index)
            con.ev_list=dict()
            real_cope_index=1
            design_matrix[ind][0]=index
            design_matrix[ind][1]=con.name
            for j in range (1,number_of_evs+1):
                ev_value=self.get_value("con_real"+index+"."+str(real_cope_index))
                con.ev_list[str(j)]=ev_value
                design_matrix[ind][j+1]=ev_value
                if self.evs[str(j)].temporal_deriv == "Y":
                    real_cope_index +=2
                else:
                    real_cope_index+=1
            self.cons[index]=con
        self.design_matrix=design_matrix
Example #2
0
 def fill_pre(self):
     self.tr=self.get_value("tr")
     self.smoothing=self.get_value("smooth")
     self.number_volumes=self.get_value("npts")
     self.removed_volumes=self.get_value("ndelete")
     self.motion_correction=binary_value_to_yes_no(self.get_value("mc"))
     self.brain_thresh=self.get_value("brain_thresh")
     input_value=self.get_value("feat_files(1)")
     if input_value:
         self.input_file=self.strip_root(input_value)