Giter Site home page Giter Site logo

khaledkhairy / em_aligner Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 10.0 534.39 MB

A set of tools to assist in aligning (registering) large numbers of EM images into a coherent image volume in two and three dimensions.

MATLAB 98.14% Shell 1.65% M 0.06% Makefile 0.10% Dockerfile 0.04%

em_aligner's People

Contributors

cgoina avatar davidackerman avatar fcollman avatar khaledkhairy avatar mlnichols avatar trautmane avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

em_aligner's Issues

randi usage in load_all_transformations causes trouble for compiled runs

The usage of randi here:

https://github.com/khaledkhairy/EM_aligner/blob/master/renderer_api/load_all_transformations.m#L10

causes problems when I run concurrent compiled solve_montage_SL processes on the same cluster node. Apparently, compiled Matlab binaries bake in the random generator seed so concurrent runs will get the same sequence of "random" numbers (see https://www.mathworks.com/matlabcentral/answers/104306-why-does-my-compiled-rand-function-give-the-same-values-every-time-i-run-my-matlab-generated-standal).

It would help to have the intended-to-be-unique-per-run file names include hostname and process id information to reduce the chance of namespace collisions. I see Matlab includes a getpid function (https://www.mathworks.com/help/symbolic/mupad_ref/getpid.html). Another option is to create a unique "work" directory within the user specified temp_dir or dir_scratch for each run - then you don't need to worry about unique names within the run "work" directory.

@davidackerman - I'm hoping you might get the chance to address this at some point but it is not critical since I've worked around it for now.

Some missing shell scripts

I believe there are some shell scripts that are missing from either this repo, or the render repo to make this work. For example, the renderer_api calls '/groups/flyTEM/flyTEM/render/bin/manage-stack.sh', which has sort of 2 problems. A) that's a hardcoded path. and B) manage-stack.sh isn't a shell script in any repo. I can see that it is likely identical to manage_stacks.sh which is part of render
[https://github.com/saalfeldlab/render/tree/master/render-ws-java-client/src/main/scripts]

However, other scripts are also referenced, such as from append_renderer_stack.sh
[https://github.com/khaledkhairy/EM_aligner/blob/master/renderer_api/append_renderer_stack.m]
where it references '/groups/flyTEM/flyTEM/render/pipeline/bin/run_ws_client.sh'.

What I would like to do is extend the rc parameters to include a renderbinPath, where you would find all these shell scripts, and I would like to point it to my render installation's render-ws-java-client/src/main/scripts directory.. or somewhere i've installed that. I can make that fall back to '/groups/flyTEM/flyTEM/render/pipeline/bin/' if its left out to keep backward compatibility at Janelia, but I need those shell scripts to be put up on github (ideally in render) to make that work for everyone, otherwise I'll have to branch out and change these calls in a manner that is specific to my environment. I'm happy to do the work and submit a pull request with the matlab modified, if either you or Eric can get the shell scripts added to render. @trautmane @khaledkhairy

can't ingest new stack with latest render scripts

After I switched to the latest render scripts, I could no longer ingest a new stack. If the stack already existed, it worked fine. Forrest identified that this command :
Running: /usr//bin/java -cp /home/danielk/usr/render/render-ws-java-client/target/render-ws-java-client-2.0.1-SNAPSHOT-standalone.jar -Xms1G -Xmx1G -Djava.awt.headless=true -XX:+UseSerialGC org.janelia.render.client.StackClient --baseDataUrl http://em-131fs:8080/render-ws/v1 --owner danielk --project MM2 --action SET_STATE --stackState LOADING --stack 6_FineSections_2325_2330xxyzy

should have --action CREATE.

I changed --action SET_STATE to --action CREATE in:
set_renderer_stack_state_loading.m

and the problem was solved.

issue with large images

Hi,

I am trying to use EM_aligner with images of human and monkey retina instead of TrakEM2 for aligning biggish stacks of images.

I installed the render project and used a tile json to load a 2 by 2 image v1-acquire stack for testing. I placed the images approximately in position by assigning each image a translation-only transform. I then tried to montage the layers based on the example at:

https://github.com/khaledkhairy/EM_aligner/blob/master/doc/doc_montage.md

I used Matlab script, montage_section_SL_prll(), to generate SURF point matches and align the 2 by 2 layers. It worked fine on the 2k by 2k example images. I then tried to montage a layer of my test stack which has 16k by 16k image tiles. This did not work. I reduced the images to 8k by 8k by cropping the non overlapping regions. This failed in the same way (see below). However, images cropped to 4k by 4k aligned without difficulty.

The alignment transforms get calculated but there are bounding box width errors when

[org.janelia.render.client.ImportMETClient] updateTiles

tries to ingest the images and new transforms into the v1_montage stack.

Perhaps there is a tile size restriction that could be relaxed? I was hoping you might understand why it fails on large images.

Thanks.

Orin Packer
U. of Washington

PS:

I am working on a Ubuntu 18.04 desktop machine with 128GB ram, 8 cores and many TB of storage. This machine won’t handle a large project but I am not taxing the memory.

The error output for the 8k by 8k tiles case (it is similar for 16k tiles):


strcmd =

'/home/daceylab/render/render-ws-java-client/src/main/scripts/run_ws_client.sh 1G org.janelia.render.client.ImportMETClient --baseDataUrl http://localhost:8080/render-ws/v1 --owner daceylab --project w10TestStack8192 --changeMode REPLACE_LAST --targetProject w10TestStack8192 --stack v1_acquire --targetStack v1_montage --targetOwner daceylab --metFile /home/daceylab/montage/scratch/X_A_358257.txt --formatVersion v1;'

org.janelia.render.client.ImportMETClient

Running: /home/daceylab/render/deploy/jdk1.8.0_131/bin/java -cp /home/daceylab/render/render-ws-java-client/target/render-ws-java-client-2.1.0-SNAPSHOT-standalone.jar -Xms1G -Xmx1G -Djava.awt.headless=true -XX:+UseSerialGC org.janelia.render.client.ImportMETClient --baseDataUrl http://localhost:8080/render-ws/v1 --owner daceylab --project w10TestStack8192 --changeMode REPLACE_LAST --targetProject w10TestStack8192 --stack v1_acquire --targetStack v1_montage --targetOwner daceylab --metFile /home/daceylab/montage/scratch/X_A_358257.txt --formatVersion v1

13:38:20.268 [main] INFO [org.janelia.render.client.ClientRunner] run: entry
13:38:20.394 [main] INFO [org.janelia.render.client.ImportMETClient] runClient: entry, parameters={
"renderWeb" : {
"baseDataUrl" : "http://localhost:8080/render-ws/v1",
"owner" : "daceylab",
"project" : "w10TestStack8192"
},
"stack" : "v1_acquire",
"targetOwner" : "daceylab",
"targetProject" : "w10TestStack8192",
"targetStack" : "v1_montage",
"metFile" : "/home/daceylab/montage/scratch/X_A_358257.txt",
"formatVersion" : "v1",
"changeMode" : "REPLACE_LAST",
"disableValidation" : false
}
13:38:20.631 [main] INFO [org.janelia.render.client.ImportMETClient] generateStackData: entry
13:38:20.635 [main] INFO [org.janelia.render.client.RenderDataClient] getStackMetaData: submitting GET http://localhost:8080/render-ws/v1/owner/daceylab/project/w10TestStack8192/stack/v1_acquire
13:38:20.706 [main] INFO [org.janelia.render.client.RenderDataClient] getStackMetaData: submitting GET http://localhost:8080/render-ws/v1/owner/daceylab/project/w10TestStack8192/stack/v1_montage
13:38:20.709 [main] INFO [org.janelia.render.client.RenderDataClient] ensureStackIsInLoadingState: v1_montage stack is already in the LOADING state
13:38:20.712 [main] INFO [org.janelia.render.client.ImportMETClient] loadV1MetData: entry, formatVersion=v1, modelClassName=mpicbg.trakem2.transform.AffineModel2D, path=/home/daceylab/montage/scratch/X_A_358257.txt
13:38:20.714 [main] INFO [org.janelia.render.client.RenderDataClient] getTile: submitting GET http://localhost:8080/render-ws/v1/owner/daceylab/project/w10TestStack8192/stack/v1_acquire/tile/1
13:38:20.741 [main] INFO [org.janelia.render.client.ImportMETClient] loadV1MetData: mapped section 1 to z value 1.0 using tile 1
13:38:20.742 [main] INFO [org.janelia.render.client.ImportMETClient] loadV1MetData: exit, loaded 4 lines for [{z: 1.0, updatedTileCount: 0}]
13:38:20.742 [main] INFO [org.janelia.render.client.ImportMETClient] updateTiles: entry, z=1.0
13:38:20.742 [main] INFO [org.janelia.render.client.RenderDataClient] getResolvedTiles: submitting GET http://localhost:8080/render-ws/v1/owner/daceylab/project/w10TestStack8192/stack/v1_acquire/z/1.0/resolvedTiles
13:38:20.751 [main] INFO [org.janelia.render.client.ImportMETClient] updateTiles: filtering tile spec collection {transformCount: 0, tileCount: 4}
13:38:20.751 [main] INFO [org.janelia.render.client.ImportMETClient] updateTiles: after filter, collection is {transformCount: 0, tileCount: 4}
13:38:20.759 [main] ERROR [org.janelia.alignment.spec.ResolvedTileSpecCollection] invalid width of 8157.0 derived for tileId '1', bounds are [10354.0, 10635.0, 18511.0, 18807.0] with transforms { "type" : "list", "specList" : [ { "type" : "leaf", "className" : "mpicbg.trakem2.transform.AffineModel2D", "dataString" : "-0.996041459980 -0.000082752902 0.000167609120 -0.997923009526 18510.083795183364 18807.485691083028" } ] }
13:38:20.759 [main] ERROR [org.janelia.alignment.spec.ResolvedTileSpecCollection] invalid width of 8074.0 derived for tileId '2', bounds are [5115.0, 10550.0, 13189.0, 18742.0] with transforms { "type" : "list", "specList" : [ { "type" : "leaf", "className" : "mpicbg.trakem2.transform.AffineModel2D", "dataString" : "-0.984963188745 -0.001050110664 0.000145430426 -0.997948014067 13188.000000000000 18742.299522346824" } ] }
13:38:20.759 [main] ERROR [org.janelia.alignment.spec.ResolvedTileSpecCollection] invalid width of 8155.0 derived for tileId '6', bounds are [10402.0, 4992.0, 18557.0, 13188.0] with transforms { "type" : "list", "specList" : [ { "type" : "leaf", "className" : "mpicbg.trakem2.transform.AffineModel2D", "dataString" : "-0.995765634434 -0.000143968291 -0.000123717261 -0.999837100681 18556.591674200601 13188.000000000000" } ] }
13:38:20.760 [main] ERROR [org.janelia.alignment.spec.ResolvedTileSpecCollection] invalid width of 8074.0 derived for tileId '7', bounds are [5203.0, 4999.0, 13277.0, 13197.0] with transforms { "type" : "list", "specList" : [ { "type" : "leaf", "className" : "mpicbg.trakem2.transform.AffineModel2D", "dataString" : "-0.984673156930 -0.000736649143 -0.000435949902 -0.999474903449 13277.841381834636 13197.565702340311" } ] }
13:38:20.760 [main] DEBUG [org.janelia.render.client.ImportMETClient] updateTiles: updated transforms for 4 tiles, removed 4 bad tiles, elapsedSeconds=0
13:38:20.760 [main] INFO [org.janelia.render.client.ImportMETClient] saveTiles: entry, z=1.0
13:38:20.763 [main] INFO [org.janelia.render.client.RenderDataClient] saveResolvedTiles: submitting PUT http://localhost:8080/render-ws/v1/owner/daceylab/project/w10TestStack8192/stack/v1_montage/z/1.0/resolvedTiles for 0 transforms and 0 tiles
13:38:20.772 [main] ERROR [org.janelia.render.client.ClientRunner] run: caught exception


Render PM "matchCount" causes issues

Eric implemented a new variable field, "matchCount" to speed up some functions. It throws off the EM_aligner and makes them discard the pointmatches between those pairs.

Running tests now as to a local fix and will propagate when done.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.