Skip to content

Commit 0cb2a2c

Browse files
authored
Merge pull request #4 from sharmishtaa/reorg_plus
Reorg plus
2 parents aa21cec + a57986e commit 0cb2a2c

File tree

157 files changed

+39875
-848
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+39875
-848
lines changed

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.eggs
2+
build
3+
dist
4+
*.egg-info/
5+
Dockerfile

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.eggs
2+
build
3+
dist
4+
*.egg-info
5+
*.pyc
6+
.ipynb_checkpoints

Dockerfile

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM fcollman/render-python
2+
MAINTAINER Forrest Collman ([email protected])
3+
4+
RUN mkdir -p /usr/local/render-python-apps
5+
WORKDIR /usr/local
6+
RUN conda install jupyter
7+
RUN pip install tifffile
8+
RUN pip install opencv-python
9+
RUN pip install pandas
10+
RUN apt-get install libspatialindex-dev -y
11+
COPY . /usr/local/render-python-apps
12+
13+
#RUN git clone http://stash.corp.alleninstitute.org/scm/~forrestc/json_module.git
14+
WORKDIR render-python-apps/renderapps/json_module
15+
#RUN git pull
16+
RUN python setup.py install
17+
18+
#RUN git clone https://github.com/fcollman/render-python-apps
19+
#WORKDIR render-python-apps
20+
#RUN git pull && git checkout newrender
21+
#RUN python setup.py install
22+
COPY jupyter_notebook_config.py /root/.jupyter/
23+
WORKDIR /usr/local/render-python-apps
24+
RUN python setup.py install
25+
CMD ["jupyter", "notebook", "--no-browser", "--allow-root"]

README.md

+129-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,129 @@
1-
# render-python
1+
# render-python-apps
2+
3+
These are a set of python based processing modules that do a broad assortment of steps in various image processing workflows whose results are ultimately stored in render. They make extensive use of the render-python library (www.github.com/fcollman/render-python) for reading metadata from render and sending it back.
4+
5+
# running a module
6+
Each module is designed to be run using a common pattern for defining inputs that is setup using the json_module pattern.
7+
8+
module can be run in 3 different ways
9+
10+
1) passing parameters via command line parameters
11+
python -m renderapps.module.example_module\
12+
--render.host RENDERHOST_DNS_OR_IP\
13+
--render.port RENDERPORT\
14+
--render.owner OWNERNAME\
15+
--render.project PROJECTNAME\
16+
--render.client_scripts PATHTORENDERSCRIPTS \
17+
--param1 P1\
18+
--param2 P2
19+
20+
note for each module you can get help about the parameters by running
21+
python -m renderapps.module.example_module --help
22+
23+
2) passing a json file from command line
24+
python -m renderapps.module.example_module --input_json path_to_json_file
25+
26+
This will read the parameters from the json file passed in. Note that command line arguments can be mixed with json definitions, and command line arguments overwrite parameters specified in the json.
27+
28+
3) calling the module from another python program
29+
30+
from renderapps.module.example_module import ExampleModule
31+
32+
module_parameters = {
33+
"render":{
34+
"host":"RENDERHOST",
35+
"port":RENDERPORT,
36+
"owner":"OWNERNAME",
37+
"project":"PROJECTNAME",
38+
"client_scripts":"PATHTORENDERSCRIPTS"
39+
},
40+
"param1":"P1",
41+
"param2":P2,
42+
}
43+
mod = ExampleModule(input_data=module_parameters, args = [])
44+
mod.run()
45+
46+
Note that passing in args =[] will bypass the command line parsing.
47+
48+
No matter how the module is run, all input parameters will be validated using the schema which each module has defined using the marshmallow framework.
49+
50+
#Repo Organization
51+
52+
The code is now organized in a sub-module structure arranged thematically by purpose.
53+
You can (or will when we are done with documentation) find more detailed descriptions of each submodule in the subfolders.
54+
55+
Here are the thematic areas
56+
57+
## dataimport
58+
These modules are related to getting data into render, including if you'd like, the generation of downsampled mipmaped image.
59+
60+
## cross_modal_registration
61+
modules for setting up trakem2 projects to register LM and EM data of the same sections.
62+
63+
## materialize
64+
modules for creating images on disk of materialized versions of transformed data
65+
66+
## pointmatch
67+
modules for making plots of point matches or doing operations on the pointmatch database
68+
69+
## registration
70+
modules for dealing with situations where you have stacks that are registered,
71+
meaning they all exist in the same space, and but you have a new transformed version of one of those stacks
72+
but you'd like to bring the rest of the registered stacks along into the new space.
73+
74+
In particular this is useful for array tomography where you have many channels of sections that you must register
75+
and then you must align the data across sections.
76+
77+
## section_polygons
78+
modules related to analyzing downsampled versions of section images of DAPI
79+
stained sections, and using fluorescent glue to automatically find the outline of the section
80+
Then subsequent modules that help you use those section polygons to filter point matches.
81+
82+
## stack
83+
modules related to doing bulk operations on a stack.
84+
85+
## stitching
86+
modules related to stitching array tomography sections, meaning within a section 2d tile montageing.
87+
88+
## tile
89+
modules related to doing single tile operations.
90+
91+
## TrakEM2
92+
modules related to importing data from render>trakem2 and bringing it back again
93+
94+
## transfer
95+
modules related to pushing render data between two render servers,
96+
and/or between local storage and the cloud.
97+
98+
## wrinkle detection
99+
start of work on a module to detect wrinkles in sections
100+
101+
# other folders
102+
103+
## module
104+
the base module classes for writing json_module style modules
105+
includes a template module example to work from
106+
107+
## json_module
108+
a subpackage related to providing a unified interface for setting parameters from a json file, or the command line, or via passing a dictionary to a class. this should go in a seperate repo eventually.
109+
110+
## obsolete
111+
modules that were written with deprecated version of render python and would need to be rewritten in the new format
112+
hopefully will go away over time.. leaving useful code here for now.
113+
114+
## refactor
115+
modules that don't use the consistent json_module pattern and should be refactored
116+
hopefully will go away as code is moved out of this..
117+
118+
# allen_utils
119+
This is a folder of miscelaneous shell scripts and files that are specific to running render python related things at the allen. they might be of interest but won't work in general for people outside of Synapse Biology at the Allen Institute.
120+
121+
# example_json
122+
This is a folder of example json files that were used to run various modules, could be a useful reference.
123+
124+
# integration_tests
125+
These should eventually contain tests for running against an integrated deployment environment, specifically configured to run inside an environment like the one specified here (https://github.com/fcollman/render-deploy/tree/test)
126+
127+
# notebooks
128+
a set of ipython notebooks that show some more interactive use of render-python and render-python apps. Mostly specific to the allen in terms of data sources, but perhaps still useful.
129+

allen_utils/create_fast_stacks.sh

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
USAGE="$0 --projectroot <PROJECT_ROOT> --owner <OWNER> --outputStackPrefix <PREFIX> --project YOURPROJECTNAME"
2+
3+
options=$(getopt -n $0 -l projectroot:,owner:,outputStackPrefix:: -- v "$@")
4+
eval set -- "$options"
5+
PREFIX=ACQ
6+
while true; do
7+
case "$1" in
8+
--projectroot)
9+
shift
10+
PROJECT_ROOT=$1;;
11+
--owner)
12+
shift
13+
OWNER=$1;;
14+
--outputStackPrefix)
15+
shift
16+
PREFIX=$1;;
17+
--)
18+
shift
19+
break;;
20+
*)
21+
echo $USAGE
22+
esac
23+
shift
24+
done
25+
shift $((OPTIND-1))
26+
PROJECT=$(basename $PROJECT_ROOT)
27+
28+
echo $PROJECT_ROOT
29+
echo $PROJECT
30+
31+
python /data/array_tomography/ForSharmi/allen_SB_code/MakeAT/make_state_table_ext_multi.py --projectDirectory $PROJECT_ROOT --outputFile $PROJECT_ROOT/scripts/statetable
32+
33+
docker exec -t renderapps python -m renderapps.dataimport.create_fast_stacks\
34+
--statetableFile $PROJECT_ROOT/scripts/statetable\
35+
--render.owner $OWNER\
36+
--render.project $PROJECT\
37+
--projectDirectory $PROJECT_ROOT\
38+
--outputStackPrefix $PREFIX\
39+
--render.host ibs-forrestc-ux1\
40+
--render.client_scripts /var/www/render/render-ws-java-client/src/main/scripts\
41+
--render.port 8080\
42+
--render.memGB 10G\
43+
--log_level INFO\
44+
--pool_size 5

allen_utils/docker_setup.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
docker pull atbigdawg:5000/fcollman/render-python:master
2+
docker tag atbigdawg:5000/fcollman/render-python:master fcollman/render-python
3+
docker build -t fcollman/render-python-apps .
4+
docker tag fcollman/render-python-apps atbigdawg:5000/fcollman/render-python-apps
5+
docker push atbigdawg:5000/fcollman/render-python-apps
6+
docker kill renderapps
7+
docker rm renderapps
8+
docker run -d --name renderapps \
9+
-v /nas:/nas \
10+
-v /nas2:/nas2 \
11+
-v /nas3:/nas3 \
12+
-v /nas4:/nas4 \
13+
-v /data:/data \
14+
-v /pipeline:/pipeline \
15+
-v /pipeline/render-python-apps:/usr/local/render-python-apps \
16+
-v /etc/hosts:/etc/hosts \
17+
-p 8888:8888 \
18+
-e "PASSWORD=$JUPYTERPASSWORD" \
19+
-i -t fcollman/render-python-apps \
20+
/bin/bash -c "/opt/conda/bin/jupyter notebook --config=/root/.jupyter/jupyter_notebook_config.py --notebook-dir=/pipeline/render-python-apps --no-browser"
21+
22+
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/pipeline/forrestrender/render-ws-java-client/src/main/scripts/run_ws_client.sh\
2+
5G org.janelia.render.client.TilePairClient\
3+
--baseDataUrl http://em-131fs:8999/render-ws/v1\
4+
--excludeCornerNeighbors true\
5+
--excludeCompletelyObscuredTiles false\
6+
--minZ 3484\
7+
--maxZ 3484\
8+
--owner gayathri\
9+
--project EM_Phase1\
10+
--stack Princeton_manual_align_testmerge\
11+
--toJson /pipeline/render-python-apps/princeton_merge_tile_pair_3484.json\
12+
--xyNeighborFactor 0.01\
13+
--zNeighborDistance 0
14+
15+
/pipeline/forrestrender/render-ws-java-client/src/main/scripts/run_ws_client.sh\
16+
5G org.janelia.render.client.
17+
18+
/var/www/render/render-ws-java-client/src/main/scripts/run_ws_client.sh\
19+
5G org.janelia.render.client.PointMatchClient\
20+
--baseDataUrl http://em-131fs:8999/render-ws/v1\
21+
--collection princeton_manual_testmatch\
22+
--owner gayathri\
23+
--renderScale .25\
24+
--matchMinNumInliers 12\
25+
http://em-131fs:8999/render-ws/v1/owner/gayathri/project/EM_Phase1/stack/Princeton_manual_align_testmerge/tile/20160802180527362_243774_7R_SID_06_redo_2_1_10_7_10.3484.0/render-parameters?normalizeForMatching=true\
26+
http://em-131fs:8999/render-ws/v1/owner/gayathri/project/EM_Phase1/stack/Princeton_manual_align_testmerge/tile/1,3484_aligned_11_33/render-parameters?normalizeForMatching=true
27+
28+
http://em-131fs:8999/render-ws/v1/owner/gayathri/project/EM_Phase1/stack/Princeton_manual_align_testmerge/tile/20160802180527362_243774_7R_SID_06_redo_2_1_10_7_10.3484.0/render-parameters?normalizeForMatching=true
29+
http://em-131fs:8999/render-ws/v1/owner/gayathri/project/EM_Phase1/stack/Princeton_manual_align_testmerge/tile/1,3484_aligned_11_33/render-parameters?normalizeForMatching=true
30+
31+
http://ibs-forrestc-ux1:8001/#!{'layers':{'dapistack':{'type':'image'_'source':'render://http://ibs-forrestc-ux1/Sharmishtaas/M270907_Scnn1aTg2Tdt_13/ALIGNEDSTACK_JAN3_DAPI_1_NORM_CONS'_'color':2}_'pointmatch':{'type':'point'_'point':'render://http://ibs-forrestc-ux1/Sharmishtaas/M270907_Scnn1aTg2Tdt_13/ALIGNEDSTACK_JAN3_DAPI_1_NORM_CONS?matchCollection=large_rigid_run'_'opacity':1_'color':4}}_'navigation':{'pose':{'position':{'voxelSize':[1_1_1]_'voxelCoordinates':[7835_6362.5_1633]}}_'zoomFactor':2}}
32+
33+
34+
35+
http://ibs-forrestc-ux1.corp.alleninstitute.org:8001/#!{'layers':{'ALIGN_JANELIA_JAN18_DAPI_1_NORM3':{'type':'image'_'source':'render://http://ibs-forrestc-ux1/Sharmishtaas/M270907_Scnn1aTg2Tdt_13/ALIGN_JANELIA_JAN18_DAPI_1_NORM3'_'color':2}_'pointmatch':{'type':'point'_'point':'render://http://ibs-forrestc-ux1/Sharmishtaas/M270907_Scnn1aTg2Tdt_13/ALIGN_JANELIA_JAN18_DAPI_1_NORM3?matchCollection=large_rigid_run'_'opacity':1_'color':4}}_'navigation':{'pose':{'position':{'voxelSize':[1_1_1]_'voxelCoordinates':[9115.9326171875_24041.474609375_499]}}_'zoomFactor':6.625978879041819}}
36+
37+
38+
http://ibs-forrestc-ux1:8001/#!{'layers':{'princeton':{'type':'image'_'source':'render://http://em-131fs:8999/gayathri/EM_Phase1/Pinky40_20170313_aibsdata_flipped_shifted?numlevels=1'_'color':1}_'manual_align_Phase1Data_3464_3500_forrestfix':{'type':'image'_'source':'render://http://em-131fs:8999/gayathri/EM_Phase1/manual_align_Phase1Data_3464_3500_forrestfix?numlevels=1'_'opacity':1_'color':2_'min':0.47_'max':0.76_'visible':false}_'Princeton_manual_align_testmerge':{'type':'point'_'point':'render://http://em-131fs:8999/gayathri/EM_Phase1/Princeton_manual_align_testmerge?matchCollection=princeton_manual_testmatch'_'opacity':1_'color':4}}_'navigation':{'pose':{'position':{'voxelSize':[1_1_1]_'voxelCoordinates':[57888.91015625_11214.361328125_3492.5]}}_'zoomFactor':12.835553661457777}}
39+
40+
http://ibs-forrestc-ux1:8001/#!{'layers':{'princeton':{'type':'image'_'source':'render://http://em-131fs:8999/gayathri/EM_Phase1/Pinky40_20170313_aibsdata_flipped_shifted?numlevels=1'_'color':1}_'manual_align_Phase1Data_3464_3500_forrestfix':{'type':'image'_'source':'render://http://em-131fs:8999/gayathri/EM_Phase1/manual_align_Phase1Data_3464_3500_forrestfix?numlevels=1'_'opacity':1_'color':2_'min':0.47_'max':0.76_'visible':false}_'Princeton_manual_align_testmerge':{'type':'point'_'point':'render://http://em-131fs:8999/gayathri/EM_Phase1/Princeton_manual_align_testmerge?matchCollection=princeton_manual_testmatch&zoffset=0'_'opacity':1_'color':4}}_'navigation':{'pose':{'position':{'voxelSize':[1_1_1]_'voxelCoordinates':[58763.81640625_11896.1630859375_3491.5]}}_'zoomFactor':5.521699376745957}}
41+
42+
http://ibs-forrestc-ux1.corp.alleninstitute.org:8001/#!{'layers':{'ALIGNEM_reg2_clahe':{'type':'image'_'source':'render://http://ibs-forrestc-ux1/Forrest/M247514_Rorb_1/ALIGNEM_reg2_clahe'_'opacity':0.44}_'ALIGNMBP_deconv':{'type':'image'_'source':'render://http://ibs-forrestc-ux1/Forrest/M247514_Rorb_1/ALIGNMBP_deconv'_'color':5_'max':0.16}_'ALIGNDAPI_1_deconv':{'type':'image'_'source':'render://http://ibs-forrestc-ux1/Forrest/M247514_Rorb_1/ALIGNDAPI_1_deconv'}_'ALIGNPSD95_deconv':{'type':'image'_'source':'render://http://ibs-forrestc-ux1/Forrest/M247514_Rorb_1/ALIGNPSD95_deconv'_'color':4_'max':0.27}_'ALIGNsynapsin_deconv':{'type':'image'_'source':'render://http://ibs-forrestc-ux1/Forrest/M247514_Rorb_1/ALIGNsynapsin_deconv'_'color':2}_'ALIGNTdTomato_deconv':{'type':'image'_'source':'render://http://ibs-forrestc-ux1/Forrest/M247514_Rorb_1/ALIGNTdTomato_deconv'_'color':1_'max':0.26}_'ALIGNGABA_deconv':{'type':'image'_'source':'render://http://ibs-forrestc-ux1/Forrest/M247514_Rorb_1/ALIGNGABA_deconv'_'color':3_'min':0.05_'max':0.36}_'pointmatch':{'type':'point'_'point':'render://http://ibs-forrestc-ux1/Forrest/M247514_Rorb_1/ALIGNDAPI_1_deconv?matchCollection=M247514_Rorb_1_DAPI1_deconv_filter_fix2'}}_'navigation':{'pose':{'position':{'voxelSize':[3_3_70]_'voxelCoordinates':[208967.046875_15017.6904296875_26]}}_'zoomFactor':115.18066077635585}_'showAxisLines':false}

allen_utils/render_links_notepad.txt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
MBP
3+
http://ibs-forrestc-ux1.corp.alleninstitute.org/render-ws/v1/owner/Forrest/project/M247514_Rorb_1/stack/ALIGNMBP_deconv/z/28/box/23927,-39746,315970,133021,.03/png-image?maxIntensity=10000&minIntensity=1000
4+
5+
DAPI
6+
http://ibs-forrestc-ux1.corp.alleninstitute.org:8081/render-ws/v1/owner/Forrest/project/M247514_Rorb_1/stack/ALIGNDAPI_1_deconv/z/28/box/23927,-39746,315970,133021,.03/png-image?maxIntensity=10000&minIntensity=1000
7+
8+
PSD95
9+
http://ibs-forrestc-ux1.corp.alleninstitute.org:8081/render-ws/v1/owner/Forrest/project/M247514_Rorb_1/stack/REGFLATPSD95/z/28/box/33510,75000,290000,120000,.03/png-image?maxIntensity=20000&minIntensity=1000
10+
http://ibs-forrestc-ux1.corp.alleninstitute.org:8081/render-ws/v1/owner/Forrest/project/M247514_Rorb_1/stack/ALIGNDAPI_1_deconv/z/28/box/23927,-39746,315970,133021,.03/png-image?maxIntensity=10000&minIntensity=1000
11+
12+
Synapsin
13+
http://ibs-forrestc-ux1.corp.alleninstitute.org:8081/render-ws/v1/owner/Forrest/project/M247514_Rorb_1/stack/REGFLATsynapsin/z/28/box/33510,75000,290000,120000,.03/png-image?maxIntensity=20000&minIntensity=0
14+
http://ibs-forrestc-ux1.corp.alleninstitute.org:8081/render-ws/v1/owner/Forrest/project/M247514_Rorb_1/stack/ALIGNDAPI_1_deconv/z/28/box/23927,-39746,315970,133021,.03/png-image?maxIntensity=10000&minIntensity=1000
15+
16+
30nm EM
17+
http://ibs-forrestc-ux1.corp.alleninstitute.org:8081/render-ws/v1/owner/Forrest/project/M247514_Rorb_1/stack/EM30nm_fix/z/28/box/33510,75000,290000,120000,.03/png-image?maxIntensity=255&minIntensity=0
18+
19+
3nm EM (rendered at 50% of full resolution in just the area it exists)
20+
http://ibs-forrestc-ux1.corp.alleninstitute.org:8081/render-ws/v1/owner/Forrest/project/M247514_Rorb_1/stack/EM_fix/z/28/box/200000,98000,18000,16000,.5/png-image?maxIntensity=255&minIntensity=0

allen_utils/reorg_setup.sh

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
docker pull atbigdawg:5000/fcollman/render-python:master
2+
docker tag atbigdawg:5000/fcollman/render-python:master fcollman/render-python
3+
docker build -t fcollman/render-python-apps:reorg .
4+
docker tag fcollman/render-python-apps:reorg fcollman/render-python-apps:reorg_testsharmi
5+
#docker push atbigdawg:5000/fcollman/render-python-apps:reorg
6+
docker kill renderapps_testsharmi
7+
docker rm renderapps_testsharmi
8+
docker run -d --name renderapps_testsharmi \
9+
-v /nas2:/nas2 \
10+
-v /nas:/nas \
11+
-v /nas3:/nas3 \
12+
-v /nas4:/nas4 \
13+
-v /data:/data \
14+
-v /pipeline:/pipeline \
15+
-v /pipeline/sharmi/Sharmi_tools/render-python-apps:/usr/local/render-python-apps \
16+
-v /etc/hosts:/etc/hosts \
17+
-p 9999:9999 \
18+
-e "PASSWORD=$JUPYTERPASSWORD" \
19+
-i -t fcollman/render-python-apps:reorg_testsharmi
20+
21+

0 commit comments

Comments
 (0)