|
@@ -219,19 +219,19 @@ def getWeights(db,r,setup,nclass,realizationId,sigma2,na):
|
|
|
|
|
|
|
|
|
#gets fitPar for a particular realization in [0..nr-1] range
|
|
|
-def getPixelFitPar(r,setup,nc,s2,mode):
|
|
|
+def getPixelFitPar(fb,r,setup,nc,s2,mode):
|
|
|
code=config.getCode(r,setup)
|
|
|
f=config.getPixelFitParFinalName(code,nc,s2,mode)
|
|
|
- getData.copyFromServer(r,setup,f)
|
|
|
+ getData.copyFromServer(fb,r,setup,[f])
|
|
|
fName=getData.getLocalPath(r,setup,f)
|
|
|
- return numpy.genFromText(fName,delimiter='\t')
|
|
|
+ return numpy.genfromtxt(fName,delimiter='\t')
|
|
|
|
|
|
-def getFitPar(r,setup,nclass,realizationId,mode):
|
|
|
+def getFitPar(fb,r,setup,nclass,realizationId,mode):
|
|
|
code=config.getCode(r,setup)
|
|
|
f=config.getFitParFinalName(code,nclass,realizationId,mode)
|
|
|
- getData.copyFromServer(r,setup,f)
|
|
|
+ getData.copyFromServer(fb,r,setup,[f])
|
|
|
fName=getData.getLocalPath(r,setup,f)
|
|
|
- return numpy.genFromText(fName,delimiter='\t')
|
|
|
+ return numpy.genfromtxt(fName,delimiter='\t')
|
|
|
|
|
|
|
|
|
def getFitParBackup(r,setup,nclass,realizationId,mode=''):
|
|
@@ -352,9 +352,15 @@ def storeSummary(db,setup,summary,sigma2,na):
|
|
|
qrow['na']=na
|
|
|
getData.updateSummary(db,setup,mode,[qrow])
|
|
|
|
|
|
-def summaryPixelIVF(db,fb,setup,sigma2,qfilter=[]):
|
|
|
+def summaryPixelIVF(db,fb,setup):
|
|
|
#for second type of analysis (pixel based regions)
|
|
|
+ qfilter=[]
|
|
|
+ try:
|
|
|
+ qfilter=setup['patientFilter']
|
|
|
+ except KeyError:
|
|
|
+ pass
|
|
|
rows=getData.getPatients(db,setup,qfilter)
|
|
|
+ sigma2=setup['sigma2']
|
|
|
return \
|
|
|
{config.getCode(r,setup):\
|
|
|
{s2:getPixelIVF(db,fb,r,setup,s2) for s2 in sigma2} for r in rows}
|
|
@@ -389,16 +395,16 @@ def storeIVF(db,setup,summary):
|
|
|
getData.updateSummary(db,setup,mode,[qrow])
|
|
|
|
|
|
def getPixelIVF(db,fb,r,setup,sigma2):
|
|
|
- #idFilter=config.getIdFilter(r,setup)
|
|
|
- #visitFilter=config.getVisitFilter(r,setup)
|
|
|
- #rows=getData.getSegmentation(db,setup,[idFilter,visitFilter])
|
|
|
- #nclassIVF=len(rows)
|
|
|
+ idFilter=config.getIdFilter(r,setup)
|
|
|
+ visitFilter=config.getVisitFilter(r,setup)
|
|
|
+ rows=getData.getSegmentation(db,setup,[idFilter,visitFilter])
|
|
|
+ nclassIVF=len(rows)
|
|
|
|
|
|
- x=segmentation.loadSegmentation(db,fb,r,setup)
|
|
|
- nclassIVF=x.shape[0]
|
|
|
+ #x=segmentation.loadSegmentation(db,fb,r,setup)
|
|
|
+ #nclassIVF=x.shape[0]
|
|
|
#this assumes segmentation is loaded
|
|
|
#nclassIVF=segmentation.getNC(r,setup)
|
|
|
#fitPar=getFitPar(r,setup,nclassIVF,sigma2,'PixelIVF')
|
|
|
- fitPar=getPixelFitPar(r,setup,nclassIVF,sigma2,'IVF')
|
|
|
+ fitPar=getPixelFitPar(fb,r,setup,nclassIVF,sigma2,'IVF')
|
|
|
k1={r['regionId']:getK1(fitPar,r['regionId']) for r in rows}
|
|
|
return k1
|