Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new local annotation format #16

Open
wants to merge 71 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
9da7e42
made a simple trakem2 import module
fcollman Oct 2, 2017
9db3bd4
Merge branch 'simple_trakem2_import' into develop
fcollman Oct 11, 2017
3037c04
changed import order
fcollman Oct 11, 2017
3b1020c
fixing bugs in registration apps
fcollman Oct 11, 2017
d8a4769
fixed apply alignment to deal with mismatched zs
fcollman Oct 12, 2017
c533038
added split stack modules
fcollman Oct 29, 2017
86075ab
Merge branch 'develop' of github.com:fcollman/render-python-apps into…
fcollman Nov 3, 2017
d706e2d
Merge branch 'develop' of https://github.com/AllenInstitute/render-py…
fcollman Nov 3, 2017
21c6c0b
adapted to a more general file name that just has a specific suffix
sharmishtaa Nov 3, 2017
c3b8fde
Merge branch 'develop' into applyframe_bug
sharmishtaa Nov 3, 2017
f3b5dcf
indent fix
sharmishtaa Nov 3, 2017
14ab0ae
indent fix
sharmishtaa Nov 3, 2017
eee316e
Merge pull request #19 from AllenInstitute/applyframe_bug
sharmishtaa Nov 3, 2017
f3ae6ab
fixed indent
sharmishtaa Nov 3, 2017
9c00cf0
Merge pull request #20 from AllenInstitute/fixindent
sharmishtaa Nov 3, 2017
94bf55c
changed annotation format to have z
fcollman Nov 10, 2017
0adbcbd
added z to global
fcollman Nov 10, 2017
3b5cebc
Merge branch 'develop' of github.com:fcollman/render-python-apps into…
fcollman Nov 10, 2017
51040ae
Create CONTRIBUTING.md
fcollman Nov 17, 2017
2121408
Add AWS SDK for Python.
perlman Dec 6, 2017
c88ee2e
Update to copy channels and new renderapi.
perlman Dec 8, 2017
98f015b
Updated code for moving stacks to the cloud.
perlman Dec 8, 2017
958620e
Merge pull request #3 from fcollman/eric-dev
fcollman Dec 8, 2017
a768b49
added pool option
sharmishtaa Dec 21, 2017
c314ad8
Merge pull request #21 from AllenInstitute/update_filtermatches
fcollman Dec 21, 2017
1319d3f
Uploading leila's changes - selection of z values and uploading mask
sharmishtaa Dec 22, 2017
0b8e3ed
Merge pull request #22 from AllenInstitute/uploadmask
fcollman Jan 9, 2018
e15dca7
new zoned deconvolution
ogliko Mar 8, 2018
7cde961
modified apply_deconv_zoned and added scikit-image and nomkl
ogliko Mar 9, 2018
2ad8414
Merge pull request #23 from AllenInstitute/olga_fibics
fcollman Mar 14, 2018
8735264
uncommented first two lines to specify package
ogliko Mar 14, 2018
a254eb6
Merge pull request #24 from AllenInstitute/olga_fibics
sharmishtaa Mar 14, 2018
7dfdd8c
changes to work with new libraries
sharmishtaa Mar 15, 2018
3299211
Merge pull request #25 from AllenInstitute/filter_pointmatches_poly
sharmishtaa Mar 15, 2018
a35b2ac
lightening requirements
fcollman Apr 6, 2018
7e333c4
reduces requirement strictness
fcollman Apr 6, 2018
66ba0ad
added setz option to let the output stack take the z of the destinati…
sharmishtaa Apr 23, 2018
7df8d03
Merge pull request #26 from AllenInstitute/fitptmatchesandsetz
fcollman Apr 23, 2018
e98496f
updating repo to current pipeline
fcollman May 7, 2018
c8c3ced
changed to argschema and changed module name
sharmishtaa May 10, 2018
4fc21f7
Merge pull request #27 from AllenInstitute/fix_squeezestack
sharmishtaa May 10, 2018
aa5403a
adding option for buffer size in creating trakem2 projects
sharmishtaa May 30, 2018
7094a8f
Merge pull request #28 from AllenInstitute/addbuffer
sharmishtaa May 30, 2018
9be5065
making a big commit to sync with repo
fcollman Jun 1, 2018
1a14023
Merge branch 'master' of github.com:AllenInstitute/render-python-apps…
fcollman Jun 1, 2018
e05a072
merging
fcollman Jun 1, 2018
776fe0e
merging in develop
fcollman Jun 1, 2018
d4407bb
adding new files
fcollman Jun 1, 2018
2835a54
fixing merge mistakes
fcollman Jun 1, 2018
3d35a9f
Merge pull request #29 from AllenInstitute/forrest_big_merge
sharmishtaa Jun 5, 2018
38170e6
forrest leila changes for cross modal registration
sharmishtaa Jun 13, 2018
fa969ef
adding module for filtering pointmatches with a fixed rectangle
sharmishtaa Jun 27, 2018
8b515c6
cleaning up
sharmishtaa Jun 27, 2018
020dc57
change opencv python to contrib
fcollman Jun 29, 2018
009cc52
Update requirements.txt
fcollman Jun 29, 2018
6e9fce8
Merge pull request #32 from AllenInstitute/filter_by_rectangle
fcollman Jun 29, 2018
c9b4ce2
Merge pull request #30 from AllenInstitute/forrest_leila_changes
fcollman Jun 29, 2018
9ccb66b
Update Dockerfile
fcollman Jul 9, 2018
05d5733
update requirements
fcollman Jul 9, 2018
2b9fa35
merging in alleninstitute
fcollman Jul 9, 2018
a3ab273
merging develop
fcollman Jul 9, 2018
c75fbdd
adding synapse detection
fcollman Jul 9, 2018
0682f40
merging in develop
fcollman Jul 9, 2018
d31e6b0
adding affine only
fcollman Jul 9, 2018
840e73e
adding docker ignore
fcollman Jul 9, 2018
a11ef09
merging
fcollman Jul 9, 2018
a1e986c
adding conda env script
fcollman Jul 9, 2018
d79fe88
adding module for anish annotations
fcollman Jul 9, 2018
1630191
Merge branch 'develop'
fcollman Jul 9, 2018
2b837ae
fixing opencv req
fcollman Jul 9, 2018
d48bc0a
adding an apt-get update
fcollman Jul 9, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Expand Up @@ -3,3 +3,4 @@ build
dist
*.egg-info/
Dockerfile
*.csv
8 changes: 7 additions & 1 deletion .gitignore
Expand Up @@ -6,4 +6,10 @@ dist
.ipynb_checkpoints
*.DS_Store
.vscode
*.py.save
*.py.save

cellimages
example_json/
*.png
*.ipynb
psf
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,26 @@
# Allen Institute Contribution Agreement

This document describes the terms under which you may make “Contributions” —
which may include without limitation, software additions, revisions, bug fixes, configuration changes,
documentation, or any other materials — to any of the projects owned or managed by the Allen Institute.
If you have questions about these terms, please contact us at terms@alleninstitute.org.

You certify that:

• Your Contributions are either:

1. Created in whole or in part by you and you have the right to submit them under the designated license
(described below); or
2. Based upon previous work that, to the best of your knowledge, is covered under an appropriate
open source license and you have the right under that license to submit that work with modifications,
whether created in whole or in part by you, under the designated license; or

3. Provided directly to you by some other person who certified (1) or (2) and you have not modified them.

• You are granting your Contributions to the Allen Institute under the terms of the [2-Clause BSD license](https://opensource.org/licenses/BSD-2-Clause)
(the “designated license”).

• You understand and agree that the Allen Institute projects and your Contributions are public and that
a record of the Contributions (including all metadata and personal information you submit with them) is
maintained indefinitely and may be redistributed consistent with the Allen Institute’s mission and the
2-Clause BSD license.
5 changes: 3 additions & 2 deletions Dockerfile
@@ -1,4 +1,4 @@
FROM fcollman/render-python:latest
FROM fcollman/render-modules:master
MAINTAINER Forrest Collman (forrest.collman@gmail.com)
RUN mkdir -p /usr/local/render-python-apps
WORKDIR /usr/local/render-python-apps
Expand All @@ -7,7 +7,8 @@ RUN pip install -r requirements.txt
RUN pip install setuptools --upgrade --disable-pip-version-check
RUN pip install argschema --upgrade --disable-pip-version-check
RUN pip install jupyter
RUN apt-get install libspatialindex-dev -y
RUN apt-get update && apt-get install libspatialindex-dev -y
RUN conda install nomkl
COPY . /usr/local/render-python-apps

#RUN git clone https://github.com/fcollman/render-python-apps
Expand Down
3 changes: 3 additions & 0 deletions allen_utils/conda_env_setup.sh
@@ -0,0 +1,3 @@
conda create --name render-python-apps --prefix $IMAGE_PROCESSING_DEPLOY_PATH python=2.7
source activate render-python-apps
pip install -r ../requirements.txt
13 changes: 5 additions & 8 deletions allen_utils/docker_setup.sh
@@ -1,5 +1,5 @@
docker pull atbigdawg:5000/fcollman/render-python:latest
docker tag atbigdawg:5000/fcollman/render-python:latest fcollman/render-python:latest
#docker pull atbigdawg:5000/fcollman/render-python:latest
#docker tag atbigdawg:5000/fcollman/render-python:latest fcollman/render-python:latest
docker build -t fcollman/render-python-apps .
docker tag fcollman/render-python-apps atbigdawg:5000/fcollman/render-python-apps
docker push atbigdawg:5000/fcollman/render-python-apps
Expand All @@ -10,14 +10,11 @@ docker run -t --name renderapps \
-v /nas2:/nas2 \
-v /nas3:/nas3 \
-v /nas4:/nas4 \
-v /nas5:/nas5 \
-v /data:/data \
-v /pipeline:/pipeline \
-v /pipeline/render-python-apps:/usr/local/render-python-apps \
-v /etc/hosts:/etc/hosts \
--dns 10.128.104.10 \
-p 8888:8888 \
-p 7777:7777 \
-e "PASSWORD=$JUPYTERPASSWORD" \
-i -t fcollman/render-python-apps \
/bin/bash -c "/opt/conda/bin/jupyter notebook --config=/root/.jupyter/jupyter_notebook_config.py --notebook-dir=/pipeline/render-python-apps --no-browser --allow-root"


-i -t fcollman/render-python-apps
25 changes: 12 additions & 13 deletions allen_utils/reorg_setup.sh
@@ -1,21 +1,20 @@
docker pull atbigdawg:5000/fcollman/render-python:master
docker tag atbigdawg:5000/fcollman/render-python:master fcollman/render-python
docker build -t fcollman/render-python-apps:reorg .
docker tag fcollman/render-python-apps:reorg fcollman/render-python-apps:reorg_testsharmi
docker push atbigdawg:5000/fcollman/render-python-apps
docker kill renderapps_testsharmi
docker rm renderapps_testsharmi
docker run -d --name renderapps_testsharmi \
docker pull localhost:5000/fcollman/render-python:master
docker tag localhost:5000/fcollman/render-python:master fcollman/render-python
docker build -t sharmi/render-python-apps:reorg .
#docker tag fcollman/render-python-apps:reorg fcollman/render-python-apps:reorg_testsharmi
#docker push atbigdawg:5000/fcollman/render-python-apps
docker kill renderapps_develop
docker rm renderapps_develop
docker run -d --name renderapps_develop \
-v /nas2:/nas2 \
-v /nas:/nas \
-v /nas3:/nas3 \
-v /nas4:/nas4 \
-v /data:/data \
-v /pipeline:/pipeline \
-v /pipeline/sharmi/Sharmi_tools/render-python-apps:/usr/local/render-python-apps \
-v /pipeline/sharmi/Sharmi_tools/render-python-apps-branches/DEVELOP/render-python-apps:/usr/local/share/render-python-apps \
-v /etc/hosts:/etc/hosts \
-p 9999:9999 \
-p 7777:7777 \
-e "PASSWORD=$JUPYTERPASSWORD" \
-i -t fcollman/render-python-apps:reorg_testsharmi


-i -t sharmi/render-python-apps:reorg \
/bin/bash -c "jupyter notebook --config=/root/.jupyter/jupyter_notebook_config.py --no-browser --allow-root --notebook-dir=/pipeline/sharmi/Sharmi_tools/render-python-apps-branches/DEVELOP/render-python-apps"
2 changes: 1 addition & 1 deletion jupyter_notebook_config.py
Expand Up @@ -16,7 +16,7 @@
from IPython.lib import passwd

c.NotebookApp.ip = '*'
c.NotebookApp.port = 8888
c.NotebookApp.port = 7777
c.NotebookApp.open_browser = False
c.MultiKernelManager.default_kernel_name = 'python2'

Expand Down
1 change: 1 addition & 0 deletions renderapps/TrakEM2/AnnotationJsonSchema.py
Expand Up @@ -19,6 +19,7 @@ class Area(argschema.schemas.mm.Schema):
description='Nx2 numpy array of local points')
global_path = NumpyArray(argschema.fields.List(argschema.fields.Float),
description='Nx2 numpy array of global coordinates')
z = argschema.fields.Float(required=False,description="z value of tileId")

class AreaList(argschema.schemas.mm.Schema):
oid = argschema.fields.Str()
Expand Down
34 changes: 24 additions & 10 deletions renderapps/TrakEM2/ImportTrakEM2Annotations.py
Expand Up @@ -18,14 +18,15 @@
"project": "M247514_Rorb_1",
"client_scripts": "/pipeline/render/render-ws-java-client/src/main/scripts"
},
"EMstack": "ALIGNEM_reg2",
"trakem2project": "/nas4/data/EM_annotation/annotationFilesForJHU/annotationTrakEMprojects_M247514_Rorb_1/m247514_Site3Annotation_RD.xml",
"output_annotation_file": "/nas4/data/EM_annotation/annotationFilesForJHU/m247514_Site3Annotation_RD_local.json",
"output_bounding_box_file": "/nas4/data/EM_annotation/annotationFilesForJHU/m247514_Site3Annotation_RD_bb_local.json",
"EMstack": "BIGALIGN_LENS_EMclahe_all",
"trakem2project": "/nas4/data/EM_annotation/M247514_Rorb_1/m247514_Site3Annotation_MN.xml",
"output_annotation_file": "/nas3/data/M247514_Rorb_1/annotation/m247514_Site3Annotation_MN_local.json",
"output_bounding_box_file":"/nas3/data/M247514_Rorb_1/annotation/m247514_Site3Annotation_MN_bb_local.json",
"renderHome": "/pipeline/render"
}



class AnnotationConversionError(Exception):
pass

Expand Down Expand Up @@ -98,8 +99,10 @@ def convert_path_to_area(path_numpy, layer_tilespecs):
local_path_numpy[convert_point_mask_ind, :] = local_points
point_missing[convert_point_mask_ind] = 0
local_tileIds[convert_point_mask_ind] = rts.tileId

assert(np.sum(point_missing) == 0)

if np.sum(point_missing)>0:
raise AnnotationConversionError("unable to find all points {} on the tiles given {}".format(path_numpy,[ts.tileId for poly,ts,rts in layer_tilespecs]))


d = {}
d['tileIds'] = local_tileIds
Expand Down Expand Up @@ -134,7 +137,10 @@ def parse_area_lists(render_tilespecs, tem2_tilespecs, tem2_polygons, root, area
for path in paths:
# initialize the path's polygon with the entire path
path_numpy = convert_path(path, tform)
d = convert_path_to_area(path_numpy, layer_tilespecs)
try:
d = convert_path_to_area(path_numpy, layer_tilespecs)
except AnnotationConversionError as e:
raise AnnotationConversionError("error in converting synapse oid:{} id:{} on layer:{}, {}".format(al.attrib['oid'],thisid,layerid,e.args))
area_list_d['areas'].append(d)

json_output['area_lists'].append(area_list_d)
Expand Down Expand Up @@ -168,8 +174,13 @@ def run(self):
pot_render_tilespecs = self.render.run(renderapi.tilespec.get_tile_specs_from_z,
self.args['EMstack'],
ts.z)
filepath = (os.path.split(ts.ip.get(0)['imageUrl'])[
1]).split('_flip')[0]
try:
mml=ts.ip.get(0)
except KeyError:
mml = ts.channels[0].ip.get(0)


filepath = (os.path.split(mml['imageUrl'])[1]).split('_flip')[0]
pot_filepaths = [(os.path.split(t.ip.get(0)['imageUrl'])[1]).split(
'_flip')[0] for t in pot_render_tilespecs]
render_tilespecs.append(next(t for t, fp in zip(
Expand Down Expand Up @@ -204,7 +215,10 @@ def run(self):
layer_tilespecs = [(poly, ts, t) for poly, ts, t
in zip(tem2_polygons, tem2_tilespecs, render_tilespecs)
if ts.tileId in patchids]
d = convert_path_to_area(corners,layer_tilespecs)
try:
d = convert_path_to_area(corners,layer_tilespecs)
except AnnotationConversionError as e:
raise AnnotationConversionError("unable to find bounding box of layer {} z={}, due to corners not being on layers with patches {} ".format(layer.attrib['oid'],layer.attrib['z'],patchids))
area_list_d = {}
area_list_d['oid'] = layer.attrib['oid']
area_list_d['id'] = int(layer_tilespecs[0][2].z)
Expand Down