def run(): bPrintLog(' ', 0) bPrintLog('=====================================', 0) bPrintLog('Running bAlign_Batch_v7', 0) bPrintLog('=====================================', 0) if len(sys.argv) < 2: print " We need a hard-drive folder with .tif stacks as input" print " Usage: ./fiji-macosx bALign_Batch_7 <full-path-to-folder>/" # Prompt user for a folder sourceFolder = DirectoryChooser( "Please Choose A Directory Of .tif Files").getDirectory() if not sourceFolder: return 0 strippedFolder = sourceFolder.replace(' ', '') if sourceFolder != strippedFolder: print 'found a space in specified path. Pease remove spaces and try again.' print 'path:', sourceFolder errorDialog = GenericDialog('Align Batch 7 Options') errorDialog.addMessage('bAlignBatch7 Error !!!') errorDialog.addMessage('There can not be any spaces in the path.') errorDialog.addMessage('Please remove spaces and try again.') errorDialog.addMessage('Offending path is:') errorDialog.addMessage(sourceFolder) errorDialog.showDialog() return 0 else: sourceFolder = sys.argv[1] #assuming it ends in '/' if not os.path.isdir(sourceFolder): bPrintLog('\nERROR: run() did not find folder: ' + sourceFolder + '\n', 0) return 0 if (Options(sourceFolder)): runOneFolder(sourceFolder) bPrintLog('=====================================', 0) bPrintLog('Done bAlign_Batch_v7', 0) bPrintLog('=====================================', 0) bPrintLog(' ', 0)
def run(): bPrintLog(' ', 0) bPrintLog('=====================================', 0) bPrintLog('Running bAlign_Batch_v7', 0) bPrintLog('=====================================', 0) if len(sys.argv) < 2: print " We need a hard-drive folder with .tif stacks as input" print " Usage: ./fiji-macosx bALign_Batch_7 <full-path-to-folder>/" # Prompt user for a folder sourceFolder = DirectoryChooser("Please Choose A Directory Of .tif Files").getDirectory() if not sourceFolder: return 0 strippedFolder = sourceFolder.replace(' ', '') if sourceFolder != strippedFolder: print 'found a space in specified path. Pease remove spaces and try again.' print 'path:', sourceFolder errorDialog = GenericDialog('Align Batch 7 Options') errorDialog.addMessage('bAlignBatch7 Error !!!') errorDialog.addMessage('There can not be any spaces in the path.') errorDialog.addMessage('Please remove spaces and try again.') errorDialog.addMessage('Offending path is:') errorDialog.addMessage(sourceFolder) errorDialog.showDialog() return 0 else: sourceFolder = sys.argv[1] #assuming it ends in '/' if not os.path.isdir(sourceFolder): bPrintLog('\nERROR: run() did not find folder: ' + sourceFolder + '\n',0) return 0 if (Options(sourceFolder)): runOneFolder(sourceFolder) bPrintLog('=====================================', 0) bPrintLog('Done bAlign_Batch_v7', 0) bPrintLog('=====================================', 0) bPrintLog(' ', 0)
psgd.showDialog() choose = psgd.getNextNumber() choice = psgd.getCheckboxes().get(0).getState() #open a tab separated txt file with one column Frame selected if choice == 1: choose = 0 IJ.run("Table... ", "open=") frametable = WM.getWindow("selected_frames.txt") meta = frametable.getTextPanel() metaRT = TP.getResultsTable(meta) # Choose a directory directory_load = DirectoryChooser( "Select the directory of your files").getDirectory() directory_load = directory_load.replace("\\", "/") # get a list of all files in the directory dList = os.listdir(directory_load) # set a counter to 1 n = 1 for i in dList: dL = directory_load + "/" + str(i) #consider only files with .ome file ending if ".ome" in dL: #open the images as virtual stack imp = IJ.run( "Bio-Formats", "open=[" + dL + "] color_mode=Default rois_import=[ROI manager] view=Hyperstack stack_order=XYCZT use_virtual_stack"
#If okay was clicked in the 6D_processor dialog the checkboxes are read and an output is created if gd.wasOKed(): if checkbox1 == True or checkbox3 == True or checkbox2 == True: #Output option 1 is making a subset of loops, that are then exported as XYTC.tiff if checkbox1 == True: if choiceIm == True: greenwindow = WM.getWindow("green_" + title) WM.setCurrentWindow(greenwindow) impDir = IJ.getDirectory("current") impDir = impDir.replace("\\", "/") impDir = impDir + title pat = title directory_save_subset = DirectoryChooser( "Select the directory to save the files").getDirectory() directory_save_subset = directory_save_subset.replace( "\\", "/") MakeSubset(impDir, directory_save_subset, ch, frames, zplanes, loops, total, pat, title, imp2) #Output option 2 is exporting all the dataset to XYTC.tiff if checkbox2 == True or checkbox3 == True: directory_save_xytc = DirectoryChooser( "Select the directory to save the files").getDirectory() directory_save_xytc = directory_save_xytc.replace("\\", "/") pat = title XYTCZL(impDir, directory_save_xytc, ch, frames, zplanes, loops, total, pat, title) #Output option 3 is additionally creating a csv-file with information for matlab BeatSync if checkbox3 == True: directory_save = DirectoryChooser( "Select the directory to save the files").getDirectory()