def runPoreDetection(inputImp, data, ops, display): name=inputImp.getTitle() inputDataset=Utility.getDatasetByName(data, name) detectionParameters=DetectionParams() roi=inputImp.getRoi() if (roi is None): message=name+": "+Messages.NoRoi IJ.write(message) return roi=inputImp.getRoi().clone(); header, statslist=poreDetectionTrueColor(inputImp, inputDataset, roi, ops, data, display, detectionParameters) directory, overlayname, roiname=Utility.createImageNames(inputImp) statsname=directory+'truecolor_stats.csv' IJ.save(inputImp, overlayname); IJ.saveAs(inputImp, "Selection", roiname); header.insert(0,Messages.FileName) statslist.insert(0,name) print header print statslist ExportDataFunction.exportSummaryStats(statsname, header, statslist)
def runPoreDetection(inputImp, data, ops, display): name = inputImp.getTitle() inputDataset = Utility.getDatasetByName(data, name) detectionParameters = DetectionParams() roi = inputImp.getRoi() if (roi is None): message = name + ": " + Messages.NoRoi IJ.write(message) return roi = inputImp.getRoi().clone() header, statslist = poreDetectionTrueColor(inputImp, inputDataset, roi, ops, data, display, detectionParameters) directory, overlayname, roiname = Utility.createImageNames(inputImp) statsname = directory + 'truecolor_stats.csv' IJ.save(inputImp, overlayname) IJ.saveAs(inputImp, "Selection", roiname) header.insert(0, Messages.FileName) statslist.insert(0, name) print header print statslist ExportDataFunction.exportSummaryStats(statsname, header, statslist)
def runPoreDetection(inputImp, data, ops, display): # in this step get the image in the "imagej2" dataset format # this way we can take advantage of some of the new imagej2 functionality name=inputImp.getTitle() inputDataset=Utility.getDatasetByName(data, name) # this structure keeps track of detection parameters detectionParameters=DetectionParams() roi=inputImp.getRoi() # check if there is an roi on the image. If not return an error if (roi is None): message=name+": "+Messages.NoRoi IJ.write(message) return # clone the roi roi=inputImp.getRoi().clone(); # call the function that processes the UV image roilist, statslist, statsheader=poreDetectionUV(inputImp, inputDataset, roi, ops, data, display, detectionParameters) # get the names for the images that will be saved directory, overlayname, roiname=Utility.createImageNames(inputImp) # name of file to save summary stats statsname=os.path.join(directory, 'stats.csv') # save the image with overlay IJ.save(inputImp, overlayname); # save the roi IJ.saveAs(inputImp, "Selection", roiname); statsheader.insert(0,Messages.FileName) statslist.insert(0,name) ExportDataFunction.exportSummaryStats(statsname, statsheader, statslist) print statsname print statsheader print statslist
def runPoreDetection(inputImp, data, ops, display): # in this step get the image in the "imagej2" dataset format # this way we can take advantage of some of the new imagej2 functionality name = inputImp.getTitle() inputDataset = Utility.getDatasetByName(data, name) # this structure keeps track of detection parameters detectionParameters = DetectionParams() roi = inputImp.getRoi() # check if there is an roi on the image. If not return an error if (roi is None): message = name + ": " + Messages.NoRoi IJ.write(message) return # clone the roi roi = inputImp.getRoi().clone() # call the function that processes the UV image roilist, statslist, statsheader = poreDetectionUV(inputImp, inputDataset, roi, ops, data, display, detectionParameters) # get the names for the images that will be saved directory, overlayname, roiname = Utility.createImageNames(inputImp) # name of file to save summary stats statsname = os.path.join(directory, 'stats.csv') # save the image with overlay IJ.save(inputImp, overlayname) # save the roi IJ.saveAs(inputImp, "Selection", roiname) statsheader.insert(0, Messages.FileName) statslist.insert(0, name) ExportDataFunction.exportSummaryStats(statsname, statsheader, statslist) print statsname print statsheader print statslist