RunMatching(p) # write output if cf.io.outputPrefix is not None: # reset all variables by shooting once, may have been overwritten CAvmCommon.IntegrateGeodesic(p.m0,p.t,p.diffOp,\ p.m, p.g, p.ginv,\ p.scratchV1, p.scratchV2,p. scratchV3,\ p.checkpointstates, p.checkpointinds,\ Ninv=p.nInv, integMethod = p.integMethod) ca.ApplyH(It, I0, p.ginv) common.SaveITKField(p.m0, cf.io.outputPrefix + "m0.mhd") common.SaveITKField(p.ginv, cf.io.outputPrefix + "phiinv.mhd") #common.SaveITKField(p.g, cf.io.outputPrefix+"phi.mhd") common.SaveITKImage(It, cf.io.outputPrefix + "I1.mhd") # end if # end Matching if __name__ == '__main__': try: usercfg = Config.Load(spec=MatchingConfigSpec, argv=sys.argv) except Config.MissingConfigError: # Don't freak out, this should have printed a sample config to STDOUT sys.exit(1) Matching(usercfg)
plt.plot(TE) plt.title('Total Energy') plt.hold(False) plt.subplot(1, 3, 2) plt.plot(VE) plt.title('Vector Energy') plt.hold(False) plt.subplot(1, 3, 3) plt.plot(IE) plt.title('Image Energy') plt.hold(False) plt.draw() plt.show() if cf.io.outputPrefix != None: energyFilename = cf.io.outputPrefix + "Energy.pdf" plt.savefig(energyFilename) # end AtlasPlots if __name__ == '__main__': #common.DebugHere() try: usercfg = Config.Load(spec=AtlasConfigSpec, argv=sys.argv) except Config.MissingConfigError: # Don't freak out, this should have printed a sample config to STDOUT sys.exit(1) Compute.Compute(BuildAtlas, usercfg)
scratchV3.toType(ca.MEM_HOST) diff_x, diff_y, diff_z = scratchV3.asnp() plt.subplot(2, 3, 3) plt.imshow(np.squeeze(diff_x)) plt.colorbar() plt.title('X: rho.m0-n1') plt.subplot(2, 3, 6) plt.imshow(np.squeeze(diff_y)) plt.colorbar() plt.title('Y: rho.m0-n1') if cf.io.outputPrefix != None and writeOutput: plt.savefig(cf.io.outputPrefix + 'diffMomenta.pdf') del scratchV1, scratchV2, scratchV3 del imdiff # end MatchingImageMomentalots if __name__ == '__main__': #common.DebugHere() try: usercfg = Config.Load(spec=MatchingImageMomentaConfigSpec, argv=sys.argv) except Config.MissingConfigError: # Don't freak out, this should have printed a sample config to STDOUT sys.exit(1) Compute.Compute(MatchingImageMomenta, usercfg)
plt.axis('off') plt.title('\phi^{-1}') plt.subplot(2, 2, 3) display.DispImage(I0, 'I0', newFig=False, dim=cf.io.plotSliceDim, sliceIdx=cf.io.plotSlice) plt.subplot(2, 2, 4) display.DispImage(It, 'I1', newFig=False, dim=cf.io.plotSliceDim, sliceIdx=cf.io.plotSlice) plt.draw() plt.show() if cf.io.outputPrefix != None: plt.savefig(cf.io.outputPrefix + 'shooting.pdf') if __name__ == '__main__': try: usercfg = Config.Load(spec=GeodesicShootingConfigSpec, argv=sys.argv) except Config.MissingConfigError: # Don't freak out, this should have printed a sample config to STDOUT sys.exit(1) GeodesicShooting(usercfg)
break if not foundSub: # need to insert a timepoint for this subject t.append(subjectsTimeArray[i]) t.sort() # now create the subject index array for i in range(numSubjects): for j in range(len(t)): if subjectsTimeArray[i] < ( t[j] + epsilon) and subjectsTimeArray[i] > ( t[j] - epsilon): # matches update Sind Sind[i] = j break cpinds = range(1, len(t)) return (t, Sind, cpinds) # end HGMSetUpCheckpointing if __name__ == '__main__': #common.DebugHere() try: usercfg = Config.Load(spec=HGMConfigSpec, argv=sys.argv) except Config.MissingConfigError: # Don't freak out, this should have printed a sample config to STDOUT sys.exit(1) Compute.Compute(BuildHGM, usercfg)
subjectsTimes.append(singleSubjectTimes) return (subjectsIds, subjectsImagePaths, subjectsTimes) # end GeoRegLoadSubjectsDetails def GeoRegLoadSubjectsInitializations(filename): subjectsInitialImages = [] subjectsInitialMomenta = [] with open(filename, "r") as f: for line1, line2 in itertools.izip_longest(*[f] * 2): singleSubjectsInitialImage = line1.rstrip() subjectsInitialImages.append(singleSubjectsInitialImage) singleSubjectsInitialMomentum = line2.rstrip() subjectsInitialMomenta.append(singleSubjectsInitialMomentum) return (subjectsInitialImages, subjectsInitialMomenta) # end GeoRegLoadSubjectsInitializations if __name__ == '__main__': try: usercfg = Config.Load(spec=GeoRegConfigSpec, argv=sys.argv) except Config.MissingConfigError: # Don't freak out, this should have printed a sample config to STDOUT sys.exit(1) Compute.Compute(BuildGeoReg, usercfg)