コード例 #1
0
 def createSubject(self, properties):
     properties['Group'] = self.database.getGroupFromNewEntry(properties)
     subject = None
     if self.settings.subjectCreationType == 'Simple':
         subject = patientalloc.Subject(properties)
     elif self.settings.subjectCreationType == 'BCI':
         matching_subject_id = self.getMatchingSubjectId()
         subject = patientalloc.BCISubject(properties,
                                           self.settings.savingProperties,
                                           matching_subject_id)
     return subject
コード例 #2
0
 def createSubject(self, properties):
     subject = None
     if self.settings.subjectCreationType == 'Simple':
         subject = patientalloc.Subject(properties)
     elif self.settings.subjectCreationType == 'BCI':
         matching_subject_id, properties[
             'Group'] = self.get_matching_subject_id(properties['Group'])
         subject = patientalloc.BCISubject(properties,
                                           self.settings.savingProperties,
                                           matching_subject_id)
     return subject
コード例 #3
0
    def createSubject(self, properties):
        properties['Group'] = self.database.getGroupFromNewEntry(properties)
        self.display_frane_algorithm_results(properties)
        properties['Group'] = self.confirm_new_entry_group_manually(
            properties['Group'])

        # user_confirm = input(" ________________________________________________________\n"
        #                      "| Do you wish to change this group placement?            |\n"
        #                      " ________________________________________________________\n"
        #                      " ________________________________________________________\n"
        #                      "| WARNING: Selecting 'Y' or 'y' will automatically       |\n"
        #                      "| place the new subject entry into the opposite group.   |\n"
        #                      "| (Press 'Y'/'y' for yes, otherwise press ENTER)         |\n"
        #                      " -------------------------------------------------------- \n"
        #                      "                          ")
        # if user_confirm in ['Y', 'y']:
        #     new_group = [i for i in self.database.groups if properties['Group'] not in i]
        #     properties['Group'] = new_group[0]
        #     print("New entry manually placed into '" + properties['Group'] + "' group.")
        new_entry_group = properties['Group']
        subject = None
        if self.settings.subjectCreationType == 'Simple':
            subject = patientalloc.Subject(properties)
        elif self.settings.subjectCreationType == 'BCI':
            # new_entry_group_orig = new_entry_group
            matching_subject_id, properties[
                'Group'] = self.get_matching_subject_id(new_entry_group)
            if new_entry_group != properties['Group']:
                print("New Entry placed in '" + properties['Group'] +
                      "' Group (based on limited matched BCI subjects)")
                self.app.infoBox(
                    "NEW GROUP PLACEMENT",
                    "New Entry placed in '" + properties['Group'] +
                    "' Group (based on limited matched BCI subjects)")
            subject = patientalloc.BCISubject(properties,
                                              self.settings.savingProperties,
                                              matching_subject_id)
        return subject
コード例 #4
0
 def testSubjectCreation(self):
     properties = {"SubjectId", '', "Age", '', "Group", ''}
     self.subject = patientalloc.Subject(properties)
     self.assertEqual(self.subject.properties, properties)