Created
September 6, 2013 11:21
-
-
Save miura/6462538 to your computer and use it in GitHub Desktop.
loading multiple tif files and store them in a list.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
loading multiple tif files and store them in a list. | |
''' | |
import os | |
from ij import IJ | |
from ij.io import DirectoryChooser | |
def run(): | |
srcDir = DirectoryChooser("Choose!").getDirectory() | |
IJ.log("directory: "+srcDir) | |
imps = [] | |
for root, directories, filenames in os.walk(srcDir): | |
for filename in filenames: | |
if not filename.endswith(".tif"): | |
continue | |
print filename | |
fullpath = os.path.join(root, filename) | |
print fullpath | |
imp = ImagePlus(fullpath) | |
imps.append(imp) | |
return imps | |
imps = run() | |
print len(imps) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment