if (DataType == 'Structural') and (SubjectSessionsType.count('strc') > 1): for i in xrange(0, len(SubjectSessions)): if (SubjectSessions[i].find('xtr') != -1): relevantSession = SubjectSessions[i] PrintList = list() #=============================================================================== # Do ALL for a given set of directories... #=============================================================================== for i in xrange(0, len(FileURIs)): for j in xrange(0, len(Keywords)): if (FileURIs[i].find(Keywords[j] + '/' + FileNames[i].replace('"', '')) != -1) and (FileSessions[i] == relevantSession): getHCP.DestinationDir = DestDir + Keywords[j] getHCP.writeFileFromURL([FileURIs[i]]) PrintList.append(FileURIs[i]) #currDestDir = os.path.normpath(destDir +os.sep+ SourceDir) #getHCP.fWriteFileFromURL(PrintList) PrintList = list() #=============================================================================== # Do T1w file specific matching... #=============================================================================== SourceDir = 'T1w/' for i in xrange(0, len(FileURIs)): for j in xrange(0, len(T1wList)): if (FileURIs[i].find(SourceDir + T1wList[j]) != -1) and (FileSessions[i] == relevantSession): getHCP.DestinationDir = DestDir + SourceDir
#=============================================================================== # make a list of quality and series for printing... ScanTypeIdx = [k for k, element in enumerate(ScanType) if (element == 'T1w') or (element == 'T2w')] for k in xrange(0, len(ScanTypeIdx)): writeScanQuality.append(Quality[ScanTypeIdx[k]]) writeScanSeries.append(Series[ScanTypeIdx[k]]) outputFileAppend = 'Quality' outputDirPrepend = 'Quality' outputFileBase = getHCP.Session outputDirFile = '%s\\%s\\%s%s' % (outputDir, outputDirPrepend, outputFileBase, outputFileExt) fPrintTabList( outputDirFile, ['Quality', 'Series'], writeScanQuality, writeScanSeries) #=============================================================================== AssessorIDs = getHCP.getAssessorIDs( ) AssessorFileURIList = getHCP.getAssessorOutputFile( AssessorIDs ) for k in xrange(0, len(AssessorFileURIList)): currURI = AssessorFileURIList[k] if ( (currURI.find('Fourier') != -1) and (currURI.find('txt') != -1) and not (currURI.find('BOLD') != -1) ): writeAssessorFileURIList.append(currURI) getHCP.writeFileFromURL(writeAssessorFileURIList) #=============================================================================== print("Duration: %s" % (time.time() - sTime))
ScanTypeIdx = [ k for k, element in enumerate(ScanType) if (element == 'T1w') or (element == 'T2w') ] for k in xrange(0, len(ScanTypeIdx)): writeScanQuality.append(Quality[ScanTypeIdx[k]]) writeScanSeries.append(Series[ScanTypeIdx[k]]) outputFileAppend = 'Quality' outputDirPrepend = 'Quality' outputFileBase = getHCP.Session outputDirFile = '%s\\%s\\%s%s' % (outputDir, outputDirPrepend, outputFileBase, outputFileExt) fPrintTabList(outputDirFile, ['Quality', 'Series'], writeScanQuality, writeScanSeries) #=============================================================================== AssessorIDs = getHCP.getAssessorIDs() AssessorFileURIList = getHCP.getAssessorOutputFile(AssessorIDs) for k in xrange(0, len(AssessorFileURIList)): currURI = AssessorFileURIList[k] if ((currURI.find('Fourier') != -1) and (currURI.find('txt') != -1) and not (currURI.find('BOLD') != -1)): writeAssessorFileURIList.append(currURI) getHCP.writeFileFromURL(writeAssessorFileURIList) #=============================================================================== print("Duration: %s" % (time.time() - sTime))