Ejemplo n.º 1
0
    def getSessionMeta(self):
#        SessionMeta = {'IDs':ScanIds, 'Types':ScanTypes, 'Series':ScanSeries, 'Quality':ScanQualty, 'XNATID':ScanXnatId }
        global getHCP

        getHCP.Session = str(self.sessionsListWidget.currentItem().text())
#        getHCP.Session = str(self.sessionsComboBox.currentText())
        SessionMeta = getHCP.getSessionMeta()
#        self.typeTextEdit.setText('\n'.join(SessionMeta.get('Types')))
#        self.seriesTextEdit.setText('\n'.join(SessionMeta.get('Series')))
#        self.qualityTextEdit.setText('\n'.join(SessionMeta.get('Quality')))
        
        Types = SessionMeta.get('Types')
        Series = SessionMeta.get('Series')
        Quality = SessionMeta.get('Quality')
        
#        self.sessionMetaTableWidget.clearContents()
#        self.sessionMetaTableWidget.clear()
        self.sessionMetaTableWidget.clearSpans()
        self.sessionMetaTableWidget.setRowCount(0)
        

        self.sessionMetaTableWidget.setHorizontalHeaderItem(0, QtGui.QTableWidgetItem('Types'))
        self.sessionMetaTableWidget.setHorizontalHeaderItem(1, QtGui.QTableWidgetItem('Series'))
        self.sessionMetaTableWidget.setHorizontalHeaderItem(2, QtGui.QTableWidgetItem('Quality'))
        for i in xrange(0, len(Types)):

            self.sessionMetaTableWidget.removeRow(i)
            self.sessionMetaTableWidget.insertRow(i)
            self.sessionMetaTableWidget.setItem(i, 0, QtGui.QTableWidgetItem(Types[i]))
            self.sessionMetaTableWidget.setItem(i, 1, QtGui.QTableWidgetItem(Series[i]))
            self.sessionMetaTableWidget.setItem(i, 2, QtGui.QTableWidgetItem(Quality[i]))
Ejemplo n.º 2
0
    def getSessionMeta(self):
        #        SessionMeta = {'IDs':ScanIds, 'Types':ScanTypes, 'Series':ScanSeries, 'Quality':ScanQualty, 'XNATID':ScanXnatId }
        global getHCP

        getHCP.Session = str(self.sessionsListWidget.currentItem().text())
        #        getHCP.Session = str(self.sessionsComboBox.currentText())
        SessionMeta = getHCP.getSessionMeta()
        #        self.typeTextEdit.setText('\n'.join(SessionMeta.get('Types')))
        #        self.seriesTextEdit.setText('\n'.join(SessionMeta.get('Series')))
        #        self.qualityTextEdit.setText('\n'.join(SessionMeta.get('Quality')))

        Types = SessionMeta.get('Types')
        Series = SessionMeta.get('Series')
        Quality = SessionMeta.get('Quality')

        #        self.sessionMetaTableWidget.clearContents()
        #        self.sessionMetaTableWidget.clear()
        self.sessionMetaTableWidget.clearSpans()
        self.sessionMetaTableWidget.setRowCount(0)

        self.sessionMetaTableWidget.setHorizontalHeaderItem(
            0, QtGui.QTableWidgetItem('Types'))
        self.sessionMetaTableWidget.setHorizontalHeaderItem(
            1, QtGui.QTableWidgetItem('Series'))
        self.sessionMetaTableWidget.setHorizontalHeaderItem(
            2, QtGui.QTableWidgetItem('Quality'))
        for i in xrange(0, len(Types)):

            self.sessionMetaTableWidget.removeRow(i)
            self.sessionMetaTableWidget.insertRow(i)
            self.sessionMetaTableWidget.setItem(
                i, 0, QtGui.QTableWidgetItem(Types[i]))
            self.sessionMetaTableWidget.setItem(
                i, 1, QtGui.QTableWidgetItem(Series[i]))
            self.sessionMetaTableWidget.setItem(
                i, 2, QtGui.QTableWidgetItem(Quality[i]))
Ejemplo n.º 3
0
else: PipelineSubString = None
    
UsableList = ['good', 'excellent', 'usable', 'undetermined']



linIdx = 0
for h in xrange(0, len(SubjectsList)): 
    getHCP.Subject = SubjectsList[h]
    SubjectSessions = getHCP.getSubjectSessions()
    SubjectMetaData = getHCP.getSubjectMeta()
    
    # find correct session...
    for i in xrange(0, len(SubjectSessions.get('Sessions'))):
        getHCP.Session = SubjectSessions.get('Sessions')[i]
        sessionMeta = getHCP.getSessionMeta()
        if (FunctSeries != None) and (FunctSeries in sessionMeta.get('Series')):
            break
        else: 
            try:
                getHCP.Session = SubjectSessions.get('Sessions')[SubjectSessions.get('Types').index(PipelineSubString[0])]
            except:
                break
            
    sessionMeta = getHCP.getSessionMeta()
    seriesList = sessionMeta.get('Series')
    typeList = sessionMeta.get('Types')
    idList = sessionMeta.get('IDs')
    qualityList = sessionMeta.get('Quality')
    
    # build the subject specific functional lists...
# Looper...
#unique sorted....
#100307,103414,103515,103818,105115,110411,111312,113619,114924,115320,116120,117122,118730,118932,119833,120212,123117,124422,125525,128632,129028,130013,133827,133928,134324,135932,136833,137128,138231,139637,140420,142828,143325,144226,149337,149539,150423,151223,151627,156637,158035,161731,162329,163432,167743,169343,172332,175439,177746,182739,182840,185139,191437,192439,192540,193239,194140,195647,196144,197550,199150,199251,200614,201111,205119,205725,209733,210617,212318,214019,214221,214423,217429,221319,249947,293748,298051,304020,307127,329440,397760,414229,448347,485757,499566,528446,530635,552544,559053,579665,581349,585862,598568,627549,638049,645551,654754,665254,672756,677968,685058,688569,702133,729557,732243,734045,748258,753251,788876,792564,826353,856766,857263,859671,861456,865363,872158,877168,885975,887373,889579,894673,896778,896879,901139,917255,932554,937160,984472,
#===============================================================================
SubjectList = list()
SubjectResource = list()
Subjects = Subjects.split(',')
SuccessBool = list()
#Subjects = ['174437']

for i in xrange(0, len(Subjects)):
    print Subjects[i]
    getHCP.Subject = Subjects[i]
    getHCP.Session = '%s_3T' % getHCP.Subject
    subjectResources = getHCP.getSubjectResources()
    subjectSessionMeta = getHCP.getSessionMeta()
    subjectSeries = subjectSessionMeta.get('Series')
    subjectType = subjectSessionMeta.get('Types')
    
    

    
    FunctionalList = list()
    for j in xrange(0, len(subjectSessionMeta.get('Types'))):
        if (subjectSessionMeta.get('Types')[j] == 'tfMRI') or (subjectSessionMeta.get('Types')[j] == 'rfMRI'):
            FunctionalList.append(subjectSessionMeta.get('Series')[j])
                
                
    if ('404 Error' in subjectResources):
        pass
    else:
# Looper...
#unique sorted....
#100307,103414,103515,103818,105115,110411,111312,113619,114924,115320,116120,117122,118730,118932,119833,120212,123117,124422,125525,128632,129028,130013,133827,133928,134324,135932,136833,137128,138231,139637,140420,142828,143325,144226,149337,149539,150423,151223,151627,156637,158035,161731,162329,163432,167743,169343,172332,175439,177746,182739,182840,185139,191437,192439,192540,193239,194140,195647,196144,197550,199150,199251,200614,201111,205119,205725,209733,210617,212318,214019,214221,214423,217429,221319,249947,293748,298051,304020,307127,329440,397760,414229,448347,485757,499566,528446,530635,552544,559053,579665,581349,585862,598568,627549,638049,645551,654754,665254,672756,677968,685058,688569,702133,729557,732243,734045,748258,753251,788876,792564,826353,856766,857263,859671,861456,865363,872158,877168,885975,887373,889579,894673,896778,896879,901139,917255,932554,937160,984472,
#===============================================================================
SubjectList = list()
SubjectResource = list()
Subjects = Subjects.split(',')
SuccessBool = list()
#Subjects = ['174437']

for i in xrange(0, len(Subjects)):
    print Subjects[i]
    getHCP.Subject = Subjects[i]
    getHCP.Session = '%s_3T' % getHCP.Subject
    subjectResources = getHCP.getSubjectResources()
    subjectSessionMeta = getHCP.getSessionMeta()
    subjectSeries = subjectSessionMeta.get('Series')
    subjectType = subjectSessionMeta.get('Types')

    FunctionalList = list()
    for j in xrange(0, len(subjectSessionMeta.get('Types'))):
        if (subjectSessionMeta.get('Types')[j]
                == 'tfMRI') or (subjectSessionMeta.get('Types')[j] == 'rfMRI'):
            FunctionalList.append(subjectSessionMeta.get('Series')[j])

    if ('404 Error' in subjectResources):
        pass
    else:
        subjectResources = subjectResources.get('Names')
        SubjectListTmp = list()
        SubjectResourceTmp = list()
Ejemplo n.º 6
0
# getSessionId
# getSessionMeta
# getSessionQuality
# getSubjectResourceMeta
# getSubjectResourcesMeta
# getSubjects
# getSubjectSessions
# getSubjectsSessions
# getURLString
#==============================================================================

    Projects = getHCP.getProjects()
    getHCP.Subject = getHCP.Subjects[0]
    getHCP.SubjectSessions = getHCP.getSubjectSessions()
    getHCP.Session = getHCP.SubjectSessions.get('Sessions')[0]
    getHCP.SessionMeta = getHCP.getSessionMeta()
    

    ScanParms = getHCP.getScanParms()
    ScanMeta = getHCP.getScanMeta()
    
    print ScanMeta.get('URIs')[ScanMeta.get('Collections').index('NIFTI')]
    writeHCP.writeFileFromURL(getHCP, ScanMeta.get('URIs')[ScanMeta.get('Collections').index('NIFTI')])
    
    if (getHCP.Server.find('intradb') != -1):
        AssessorIDs = getHCP.getAssessorIDs( )
        AssessorFileURIList = getHCP.getAssessorOutputFile( AssessorIDs )
        
        
    print getHCP.getProjects()
    print getHCP.SessionId, getHCP.getSessionId()