Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
ENH: Try using Python instead of Groovy
- Loading branch information
Showing
2 changed files
with
55 additions
and
54 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# @DatasetIOService ds | ||
# @UIService ui | ||
# @File(label="Raw images directory", description="Images path", style="directory", value="/share/Pariksheet/consultations/rnai-screen-tf/results/z_projection") path | ||
# @String(label="Plate name", choices={"160415_015529-V", "501B102", "502B98", "503B99", "507B99"}) plate | ||
# @String(label="Well", value="C03") well | ||
# @OUTPUT Dataset image | ||
|
||
# It looks like the only "ImageJ2" way of opening a single-TIFF | ||
# image series is using the big data viewer: | ||
# http://forum.imagej.net/t/wrap-imageplus-virtualstack-into-imglib2/4154/10 | ||
# The big data viewer VirtualStackImageLoader requires an ImagePlus as input. | ||
|
||
# Open the image stack and convert to hyperstack | ||
import glob | ||
import os.path | ||
|
||
files = glob.glob(os.path.join(str(path), "{}_{}*".format(plate, well))) | ||
files.sort() | ||
# There doesn't seem to be a trivial way to read multiple files. | ||
#ims = [ds.open(filename) for filename in files] | ||
#print(type(ims[0])) | ||
from io.scif.config import SCIFIOConfig | ||
from io.scif.img import ImgOpener | ||
#from io.scif import SCIFIO | ||
import net.imagej.ImageJ as ij | ||
|
||
config = ( | ||
SCIFIOConfig() | ||
.groupableSetGroupFiles(True) | ||
) | ||
im = ds.open(files[0], config) | ||
print(im) | ||
#ds = ij.scifio()#.datasetIO().open(files[0], config); | ||
#im = ImgOpener().openImg(files[0], config) | ||
#print(dir(im)) | ||
#print(im.metadata.getImageCount()) | ||
|
||
#scifio = SCIFIO() | ||
#reader = scifio.initializer().initializeReader(files[0]) | ||
#print(reader.getMetadata().getImageCount()) | ||
|
||
#from ij import IJ, WindowManager | ||
#IJ.run("Image Sequence...", | ||
# "open={path} file={pattern} sort".format( | ||
# path=path, pattern="{}_{}".format(plate, well))) | ||
#im = WindowManager.getCurrentImage() | ||
#IJ.run("Stack to Hyperstack...", | ||
# "order=xyctz channels=3 slices=1 frames={frames} display=Composite".format( | ||
# frames=im.getNSlices() / 3)) | ||
#IJ.Stack.setActiveChannels("011"); | ||
#IJ.run("Blue"); | ||
#IJ.Stack.setActiveChannels("101"); | ||
#IJ.run("Red"); | ||
#IJ.Stack.setActiveChannels("110"); | ||
#IJ.run("Green"); |