Start this notebook with DEBUG=matrixscreener ipython notebook for debug output.


In [1]:
import py
from py import path
root = path.local.get_temproot()
root.join('stitch-notebook').remove()
tmpdir = root.mkdir('stitch-notebook')
tmpdir.mkdir('stitched')


Out[1]:
local('/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/stitched')

In [2]:
def experiment():
    from matrixscreener.experiment import Experiment
    e = path.local('../tests/experiment--test')
    e.copy(tmpdir.mkdir('experiment'))
    return Experiment(tmpdir.join('experiment').strpath)

In [3]:
e = experiment()

In [4]:
e


Out[4]:
matrixscreener.Experiment(/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment)

In [5]:
e.stitch(folder=tmpdir.join('stitched').strpath)


Fri, 06 Feb 2015 16:12:03 GMT matrixscreener 'stitching matrixscreener.Experiment(/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment)' +0.0us
Fri, 06 Feb 2015 16:12:03 GMT matrixscreener 'stitching /var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00 to /var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/stitched' +883.0us
Fri, 06 Feb 2015 16:12:03 GMT matrixscreener "channels ['00', '01']" +4.4ms
Fri, 06 Feb 2015 16:12:03 GMT matrixscreener "z-stacks ['00']" +95.0us
Fri, 06 Feb 2015 16:12:03 GMT matrixscreener 'filenames field--X{xx}--Y{yy}/image--L00--S00--U00--V00--J20--E00--O00--X{xx}--Y{yy}--T00--Z00--C00.tif' +122.0us
Fri, 06 Feb 2015 16:12:03 GMT matrixscreener 'output_file stitched--U00--V00--C00--Z00.png' +363.0us
Fri, 06 Feb 2015 16:12:03 GMT matrixscreener 'rel_filename ../../../stitched/stitched--U00--V00--C00--Z00.png' +107.0us
Fri, 06 Feb 2015 16:12:03 GMT matrixscreener 'filenames field--X{xx}--Y{yy}/image--L00--S00--U00--V00--J20--E00--O00--X{xx}--Y{yy}--T00--Z00--C01.tif' +249.0us
Fri, 06 Feb 2015 16:12:03 GMT matrixscreener 'output_file stitched--U00--V00--C00--Z00.png' +138.0us
Fri, 06 Feb 2015 16:12:03 GMT matrixscreener 'rel_filename ../../../stitched/stitched--U00--V00--C00--Z00.png' +91.0us
Fri, 06 Feb 2015 16:12:03 GMT matrixscreener 'macro [\'run("Grid/Collection stitching", "type=[Filename defined position] order=[Defined by filename         ] grid_size_x=1 grid_size_y=2 tile_overlap=10 first_file_index_x=0 first_file_index_y=0 directory=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00] file_names=field--X{xx}--Y{yy}/image--L00--S00--U00--V00--J20--E00--O00--X{xx}--Y{yy}--T00--Z00--C00.tif output_textfile_name=TileConfiguration.txt fusion_method=[Linear Blending] regression_threshold=0.30 max/avg_displacement_threshold=2.50 absolute_displacement_threshold=3.50 compute_overlap subpixel_accuracy computation_parameters=[Save computation time (but use more RAM)] image_output=[Fused and display]"); selectWindow("Fused"); run("Save", "save=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00/../../../stitched/stitched--U00--V00--C00--Z00.png]"); close();\', \'run("Grid/Collection stitching", "type=[Filename defined position] order=[Defined by filename         ] grid_size_x=1 grid_size_y=2 tile_overlap=10 first_file_index_x=0 first_file_index_y=0 directory=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00] file_names=field--X{xx}--Y{yy}/image--L00--S00--U00--V00--J20--E00--O00--X{xx}--Y{yy}--T00--Z00--C01.tif output_textfile_name=TileConfiguration.txt fusion_method=[Linear Blending] regression_threshold=0.30 max/avg_displacement_threshold=2.50 absolute_displacement_threshold=3.50 compute_overlap subpixel_accuracy computation_parameters=[Save computation time (but use more RAM)] image_output=[Fused and display]"); selectWindow("Fused"); run("Save", "save=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00/../../../stitched/stitched--U00--V00--C00--Z00.png]"); close();\']' +95.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:java.lang.IllegalArgumentException: Could not handle HTTPS in public boolean install(java.lang.String path) in ij.plugin.PluginInstaller' +1.1m
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat net.imagej.patcher.CodeHacker.handleHTTPS(CodeHacker.java:1221)' +1.0ms
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat net.imagej.patcher.LegacyExtensions.injectHooks(LegacyExtensions.java:286)' +49.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat net.imagej.patcher.LegacyInjector.inject(LegacyInjector.java:308)' +31.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat net.imagej.patcher.LegacyInjector.injectHooks(LegacyInjector.java:109)' +43.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat net.imagej.patcher.LegacyEnvironment.initialize(LegacyEnvironment.java:101)' +40.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat net.imagej.patcher.LegacyEnvironment.applyPatches(LegacyEnvironment.java:495)' +29.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat net.imagej.patcher.LegacyInjector.preinit(LegacyInjector.java:397)' +25.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat net.imagej.patcher.LegacyInjector.preinit(LegacyInjector.java:376)' +25.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat net.imagej.legacy.DefaultLegacyService.<clinit>(DefaultLegacyService.java:124)' +26.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)' +25.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)' +26.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)' +25.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat java.lang.reflect.Constructor.newInstance(Constructor.java:513)' +38.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat java.lang.Class.newInstance0(Class.java:357)' +44.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat java.lang.Class.newInstance(Class.java:310)' +26.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:302)' +25.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:269)' +30.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:231)' +27.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:194)' +25.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:166)' +25.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat org.scijava.Context.<init>(Context.java:265)' +25.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat org.scijava.Context.<init>(Context.java:222)' +24.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat org.scijava.Context.<init>(Context.java:161)' +25.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat org.scijava.Context.<init>(Context.java:117)' +24.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat org.scijava.Context.<init>(Context.java:105)' +24.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat net.imagej.ImageJ.<init>(ImageJ.java:82)' +24.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat net.imagej.Main.launch(Main.java:61)' +25.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat net.imagej.Main.main(Main.java:73)' +25.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)' +24.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)' +26.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)' +57.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat java.lang.reflect.Method.invoke(Method.java:597)' +82.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:258)' +34.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:184)' +27.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:\tat net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:76)' +26.0us
Fri, 06 Feb 2015 16:13:09 GMT matrixscreener 'stderr:[INFO] Overriding Upload Sample Image; identifier: command:net.imagej.plugins.commands.upload.SampleImageUploader; jar: file:/Applications/Fiji.app/jars/imagej-plugins-commands-0.4.1.jar' +26.0us
Out[5]:
[]

In [25]:
macro = ['run("Grid/Collection stitching", "type=[Filename defined position] order=[Defined by filename         ] grid_size_x=1 grid_size_y=2 tile_overlap=10 first_file_index_x=0 first_file_index_y=0 directory=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00] file_names=field--X{xx}--Y{yy}/image--L00--S00--U00--V00--J20--E00--O00--X{xx}--Y{yy}--T00--Z00--C00.tif output_textfile_name=TileConfiguration.txt fusion_method=[Linear Blending] regression_threshold=0.30 max/avg_displacement_threshold=2.50 absolute_displacement_threshold=3.50 compute_overlap subpixel_accuracy computation_parameters=[Save computation time (but use more RAM)] image_output=[Fused and display]"); selectWindow("Fused"); run("Save", "save=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00/../../../stitched/stitched--U00--V00--C00--Z00.png]"); close();', 'run("Grid/Collection stitching", "type=[Filename defined position] order=[Defined by filename         ] grid_size_x=1 grid_size_y=2 tile_overlap=10 first_file_index_x=0 first_file_index_y=0 directory=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00] file_names=field--X{xx}--Y{yy}/image--L00--S00--U00--V00--J20--E00--O00--X{xx}--Y{yy}--T00--Z00--C01.tif output_textfile_name=TileConfiguration.txt fusion_method=[Linear Blending] regression_threshold=0.30 max/avg_displacement_threshold=2.50 absolute_displacement_threshold=3.50 compute_overlap subpixel_accuracy computation_parameters=[Save computation time (but use more RAM)] image_output=[Fused and display]"); selectWindow("Fused"); run("Save", "save=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00/../../../stitched/stitched--U00--V00--C00--Z00.png]"); close();']

In [14]:
len(macro)


Out[14]:
2

In [12]:
!ls /var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00/../../../


experiment stitched

In [26]:
macro = ' '.join(macro)

In [29]:
print(macro)


run("Grid/Collection stitching", "type=[Filename defined position] order=[Defined by filename         ] grid_size_x=1 grid_size_y=2 tile_overlap=10 first_file_index_x=0 first_file_index_y=0 directory=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00] file_names=field--X{xx}--Y{yy}/image--L00--S00--U00--V00--J20--E00--O00--X{xx}--Y{yy}--T00--Z00--C00.tif output_textfile_name=TileConfiguration.txt fusion_method=[Linear Blending] regression_threshold=0.30 max/avg_displacement_threshold=2.50 absolute_displacement_threshold=3.50 compute_overlap subpixel_accuracy computation_parameters=[Save computation time (but use more RAM)] image_output=[Fused and display]"); selectWindow("Fused"); run("Save", "save=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00/../../../stitched/stitched--U00--V00--C00--Z00.png]"); close(); run("Grid/Collection stitching", "type=[Filename defined position] order=[Defined by filename         ] grid_size_x=1 grid_size_y=2 tile_overlap=10 first_file_index_x=0 first_file_index_y=0 directory=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00] file_names=field--X{xx}--Y{yy}/image--L00--S00--U00--V00--J20--E00--O00--X{xx}--Y{yy}--T00--Z00--C01.tif output_textfile_name=TileConfiguration.txt fusion_method=[Linear Blending] regression_threshold=0.30 max/avg_displacement_threshold=2.50 absolute_displacement_threshold=3.50 compute_overlap subpixel_accuracy computation_parameters=[Save computation time (but use more RAM)] image_output=[Fused and display]"); selectWindow("Fused"); run("Save", "save=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00/../../../stitched/stitched--U00--V00--C00--Z00.png]"); close();

In [30]:
%%writefile macro.ijm
run("Grid/Collection stitching", "type=[Filename defined position] order=[Defined by filename         ] grid_size_x=1 grid_size_y=2 tile_overlap=10 first_file_index_x=0 first_file_index_y=0 directory=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00] file_names=field--X{xx}--Y{yy}/image--L00--S00--U00--V00--J20--E00--O00--X{xx}--Y{yy}--T00--Z00--C00.tif output_textfile_name=TileConfiguration.txt fusion_method=[Linear Blending] regression_threshold=0.30 max/avg_displacement_threshold=2.50 absolute_displacement_threshold=3.50 compute_overlap subpixel_accuracy computation_parameters=[Save computation time (but use more RAM)] image_output=[Fused and display]"); selectWindow("Fused"); run("Save", "save=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00/../../../stitched/stitched--U00--V00--C00--Z00.png]"); close(); run("Grid/Collection stitching", "type=[Filename defined position] order=[Defined by filename         ] grid_size_x=1 grid_size_y=2 tile_overlap=10 first_file_index_x=0 first_file_index_y=0 directory=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00] file_names=field--X{xx}--Y{yy}/image--L00--S00--U00--V00--J20--E00--O00--X{xx}--Y{yy}--T00--Z00--C01.tif output_textfile_name=TileConfiguration.txt fusion_method=[Linear Blending] regression_threshold=0.30 max/avg_displacement_threshold=2.50 absolute_displacement_threshold=3.50 compute_overlap subpixel_accuracy computation_parameters=[Save computation time (but use more RAM)] image_output=[Fused and display]"); selectWindow("Fused"); run("Save", "save=[/var/folders/mx/t9hzs5852cxgk0548k1vdsxr0000gn/T/stitch-notebook/experiment/slide--S00/chamber--U00--V00/../../../stitched/stitched--U00--V00--C00--Z00.png]"); close();


Overwriting macro.ijm

In [32]:
!ls


compress.ipynb macro.ijm      stitch.ipynb

In [8]:
from matrixscreener.experiment import attributes

In [9]:
attr = attributes(e.images[0])

In [26]:
'--U{U}--V{V}'.format(**attr._asdict())


Out[26]:
'--U00--V00'