├── __init__.py ├── data ├── tmp │ └── .gitkeep ├── annotator │ └── .gitkeep └── parameters │ ├── .gitkeep │ └── Filters.pickle ├── dojo ├── __init__.py ├── websockets.py ├── setup.py ├── viewer.py └── image.py ├── dojoio ├── __init__.py └── SaveChanges.py ├── system ├── __init__.py ├── Script.py └── Credit.py ├── segment ├── __init__.py ├── _2D_DNN │ ├── __init__.py │ ├── InferenceTab.py │ ├── _2D_DNN.py │ ├── LICENSE.txt │ └── TrainingTab.py ├── _3D_FFN │ ├── __init__.py │ ├── ffn │ │ ├── ffn │ │ │ ├── __init__.py │ │ │ ├── utils │ │ │ │ ├── __init__.py │ │ │ │ ├── png_to_h5.py │ │ │ │ ├── object_utils.py │ │ │ │ ├── bounding_box.proto │ │ │ │ ├── vector.proto │ │ │ │ └── geom_utils.py │ │ │ ├── inference │ │ │ │ ├── __init__.py │ │ │ │ ├── consensus.proto │ │ │ │ └── inference_flags.py │ │ │ └── training │ │ │ │ ├── __init__.py │ │ │ │ ├── variables.py │ │ │ │ ├── import_util.py │ │ │ │ └── optimizer.py │ │ ├── requirements.txt │ │ ├── CONTRIBUTING.md │ │ └── ffn_inference_demo.ipynb │ └── _3D_FFN.py ├── _tensorb │ ├── __init__.py │ ├── launch_tensorboard.py │ └── _tensorb.py └── menu.json ├── plugins ├── Blank │ ├── __init__.py │ └── Blank.py ├── Filter2D3D │ ├── __init__.py │ ├── filters │ │ ├── __init__.py │ │ ├── Invert.py │ │ ├── Gaussian.py │ │ ├── Mzur.py │ │ ├── CLAHE.py │ │ ├── Label.py │ │ ├── Canny.py │ │ ├── Label3D.py │ │ ├── Binary.py │ │ ├── Skimg.py │ │ └── Skimg3D.py │ ├── FiltersInfo.py │ └── Filter2D3D.py ├── menu.json ├── miscellaneous │ ├── SourceWidget.py │ ├── CanvasLabel.py │ ├── ParameterWidget.py │ ├── TargetWidget.py │ ├── Widget.py │ └── FilterlistGenerator.py └── Template │ ├── run_example.py │ ├── Inference.py │ ├── Template.py │ └── Training.py ├── annotator ├── Annotator │ ├── __init__.py │ ├── Annotator.py │ └── ControlAnnotatorServer.py └── menu.json ├── icons ├── Mojo.ico ├── Mojo2.png ├── Close_16.png ├── Copy_16.png ├── Folder_16.png ├── Mojo2_128.png ├── Mojo2_16.png ├── Mojo2_28.png ├── Mojo2_32.png ├── Redo_16.png ├── Redo_24.png ├── Save_16.png ├── Search_16.png ├── Undo_16.png ├── Undo_24.png ├── Database_16.png ├── DatasetLoad.png ├── Merge3D_32.png ├── Merge3D_64.png ├── Split2D_32.png ├── Split3D_32.png ├── Split3D_64.png ├── Folder_Open_16.png ├── Object_Down16.png ├── Photo_Down_16.png ├── Photo_Open_16.png ├── Photo_Right_16.png ├── Power_Off_16.png ├── Replace2D_32.png ├── Replace3D_32.png ├── Split2D_64-01.png ├── Database_Down16.png ├── Database_Open_16.png ├── Database_Right16.png ├── Disabled │ ├── Close16.png │ ├── Open16.png │ ├── Photo16.png │ ├── Redo16.png │ ├── Save16.png │ ├── Undo16.png │ ├── Database16.png │ ├── Folder16.png │ ├── Object16.png │ └── PowerOff16.png ├── Folder_Create_16.png ├── Folder_Export_16.png ├── Folder_Import_16.png ├── Folder_Right_16.png ├── Object_Export16.png ├── Object_Import_16.png ├── Object_Right_16.png ├── Photo_Export_16.png ├── Photo_Import_16.png ├── Replace2D_64-01.png ├── Replace3D_64-01.png ├── SegmentationLoad.png ├── SegmentationRedo.png ├── SegmentationSave.png ├── SegmentationUndo.png ├── Database_Export_16.png ├── SegmentationCancel.png ├── SegmentationCommit.png ├── SegmentationCompute.png ├── Database-Create-16x16.png ├── SegmentationLabelAdd.png └── illustrato_Config_For_Icon.txt ├── .gitattributes ├── _web_dojo ├── gfx │ ├── 3d.png │ ├── img.png │ ├── seg.png │ ├── Eraser.png │ ├── adjust.png │ ├── link.png │ ├── menu.png │ ├── merge.png │ ├── redo.png │ ├── save.png │ ├── split.png │ ├── undo.png │ ├── icon_esc.png │ ├── icon_tab.png │ ├── loading.jpg │ ├── 3d_selected.png │ ├── Eraser_mini.png │ ├── background.jpg │ ├── cur_large.png │ ├── cur_medium.png │ ├── cur_small.png │ ├── cursors │ │ ├── 000.ico │ │ ├── 001.ico │ │ ├── 002.ico │ │ ├── 003.ico │ │ ├── 004.ico │ │ ├── 005.ico │ │ ├── 006.ico │ │ ├── 007.ico │ │ ├── 008.ico │ │ ├── 009.ico │ │ ├── 010.ico │ │ ├── 011.ico │ │ ├── 012.ico │ │ ├── 013.ico │ │ ├── 014.ico │ │ ├── 015.ico │ │ ├── 016.ico │ │ ├── 017.ico │ │ ├── 018.ico │ │ ├── 019.ico │ │ ├── 020.ico │ │ ├── 021.ico │ │ ├── 022.ico │ │ ├── 023.ico │ │ ├── 024.ico │ │ ├── 025.ico │ │ ├── 026.ico │ │ ├── 027.ico │ │ ├── 028.ico │ │ ├── 029.ico │ │ ├── 030.ico │ │ ├── 031.ico │ │ ├── 032.ico │ │ ├── 033.ico │ │ ├── 034.ico │ │ ├── 035.ico │ │ ├── 036.ico │ │ ├── 037.ico │ │ ├── 038.ico │ │ ├── 039.ico │ │ ├── 040.ico │ │ ├── 041.ico │ │ ├── 042.ico │ │ ├── 043.ico │ │ ├── 044.ico │ │ ├── 045.ico │ │ ├── 046.ico │ │ ├── 047.ico │ │ ├── 048.ico │ │ ├── 049.ico │ │ ├── 050.ico │ │ ├── 051.ico │ │ ├── 052.ico │ │ ├── 053.ico │ │ ├── 054.ico │ │ ├── 055.ico │ │ ├── 056.ico │ │ ├── 057.ico │ │ ├── 058.ico │ │ ├── 059.ico │ │ ├── 060.ico │ │ ├── 061.ico │ │ ├── 062.ico │ │ └── 063.ico │ ├── icon_border.png │ ├── icon_delete.png │ ├── icon_lock.png │ ├── icon_mark.png │ ├── icon_mono.png │ ├── icon_move.png │ ├── icon_slice.png │ ├── icon_zoom.png │ ├── mouse_right.png │ ├── icon_opacity.png │ ├── link_selected.png │ ├── mouse_scroll.png │ ├── adjust_selected.png │ ├── exclamationmark.png │ ├── icon_brush_minus.png │ ├── icon_brush_plus.png │ ├── icon_jump_to_xyz.png │ ├── icon_jump_to_z.png │ ├── icon_lock_flip.png │ ├── icon_mono_border.png │ ├── merge_selected.png │ ├── split_selected.png │ ├── exclamationmark-original.png │ └── loading-three-dots.svg ├── gui │ ├── js │ │ ├── src │ │ │ ├── index.js │ │ │ ├── header-toolbar.js │ │ │ ├── opacity-slider.js │ │ │ ├── base-slider.js │ │ │ ├── config.js │ │ │ ├── dojo-gui.js │ │ │ └── util.js │ │ └── vendors │ │ │ ├── console-polyfill │ │ │ ├── package.json │ │ │ └── console-polyfill.js │ │ │ ├── eventbus │ │ │ ├── package.json │ │ │ ├── LICENSE │ │ │ └── eventbus.min.js │ │ │ ├── json3 │ │ │ ├── LICENSE │ │ │ └── package.json │ │ │ ├── chillout │ │ │ ├── LICENSE │ │ │ └── package.json │ │ │ ├── es7-shim │ │ │ ├── LICENSE │ │ │ └── package.json │ │ │ ├── es5-shim │ │ │ ├── LICENSE │ │ │ └── package.json │ │ │ ├── underscore │ │ │ ├── LICENSE │ │ │ └── package.json │ │ │ ├── bootstrap-slider │ │ │ └── LICENSE.md │ │ │ ├── es6-shim │ │ │ ├── LICENSE │ │ │ ├── es6-sham.min.js │ │ │ └── es6-sham.map │ │ │ └── jquery │ │ │ └── LICENSE.txt │ └── css │ │ └── vendors │ │ ├── bootstrap │ │ └── theme │ │ │ └── flatly │ │ │ ├── package.json │ │ │ └── LICENSE │ │ └── bootstrap-slider │ │ └── LICENSE.md ├── css │ ├── dragmenu.css │ └── dragresize.css └── websocket.js ├── docs └── Images │ ├── Dojo.png │ ├── _2DNN.png │ ├── 2DNN_0.png │ ├── FFN_GT.png │ ├── FFN_Prep.png │ ├── Filter.png │ ├── GT_Draw.png │ ├── 2D_Binary.png │ ├── Annotator.png │ ├── GT_import.png │ ├── mac_small.jpg │ ├── 2DNN_Training.png │ ├── android_small.jpg │ ├── linux_small.jpg │ ├── windows_small.jpg │ ├── DragDropFolders.png │ ├── 2D_Postprocessing.png │ ├── Proof_Annotation.png │ ├── Template_Training.png │ ├── _2D_Postprocessing.png │ └── Training_GroundTruth.png ├── _web_annotator ├── img │ └── favicon.ico └── js │ ├── util.js │ ├── ControlStlViewer.js │ └── GridHelper.js ├── example_script.py ├── main.py ├── .gitignore ├── hooks └── hook-tensorflow.contrib.py ├── specs ├── translate_.spec ├── tensorboard_.spec ├── build_coordinates_.spec ├── compute_partitions_.spec ├── train_.spec └── run_inference_win_.spec ├── requirements-linux.txt └── requirements-win.txt /__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/tmp/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dojo/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dojoio/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /system/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/annotator/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /segment/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /data/parameters/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /plugins/Blank/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /segment/_2D_DNN/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /segment/_3D_FFN/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /segment/_tensorb/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /annotator/Annotator/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /plugins/Filter2D3D/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /plugins/Filter2D3D/filters/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/ffn/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/ffn/utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/ffn/inference/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/ffn/training/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /icons/Mojo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Mojo.ico -------------------------------------------------------------------------------- /icons/Mojo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Mojo2.png -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /icons/Close_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Close_16.png -------------------------------------------------------------------------------- /icons/Copy_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Copy_16.png -------------------------------------------------------------------------------- /icons/Folder_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Folder_16.png -------------------------------------------------------------------------------- /icons/Mojo2_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Mojo2_128.png -------------------------------------------------------------------------------- /icons/Mojo2_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Mojo2_16.png -------------------------------------------------------------------------------- /icons/Mojo2_28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Mojo2_28.png -------------------------------------------------------------------------------- /icons/Mojo2_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Mojo2_32.png -------------------------------------------------------------------------------- /icons/Redo_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Redo_16.png -------------------------------------------------------------------------------- /icons/Redo_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Redo_24.png -------------------------------------------------------------------------------- /icons/Save_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Save_16.png -------------------------------------------------------------------------------- /icons/Search_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Search_16.png -------------------------------------------------------------------------------- /icons/Undo_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Undo_16.png -------------------------------------------------------------------------------- /icons/Undo_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Undo_24.png -------------------------------------------------------------------------------- /_web_dojo/gfx/3d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/3d.png -------------------------------------------------------------------------------- /_web_dojo/gfx/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/img.png -------------------------------------------------------------------------------- /_web_dojo/gfx/seg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/seg.png -------------------------------------------------------------------------------- /annotator/menu.json: -------------------------------------------------------------------------------- 1 | { 2 | "Open": { 3 | "Sub": 0, 4 | "Func": "Annotator" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /docs/Images/Dojo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/Dojo.png -------------------------------------------------------------------------------- /docs/Images/_2DNN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/_2DNN.png -------------------------------------------------------------------------------- /icons/Database_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Database_16.png -------------------------------------------------------------------------------- /icons/DatasetLoad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/DatasetLoad.png -------------------------------------------------------------------------------- /icons/Merge3D_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Merge3D_32.png -------------------------------------------------------------------------------- /icons/Merge3D_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Merge3D_64.png -------------------------------------------------------------------------------- /icons/Split2D_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Split2D_32.png -------------------------------------------------------------------------------- /icons/Split3D_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Split3D_32.png -------------------------------------------------------------------------------- /icons/Split3D_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Split3D_64.png -------------------------------------------------------------------------------- /_web_dojo/gfx/Eraser.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/Eraser.png -------------------------------------------------------------------------------- /_web_dojo/gfx/adjust.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/adjust.png -------------------------------------------------------------------------------- /_web_dojo/gfx/link.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/link.png -------------------------------------------------------------------------------- /_web_dojo/gfx/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/menu.png -------------------------------------------------------------------------------- /_web_dojo/gfx/merge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/merge.png -------------------------------------------------------------------------------- /_web_dojo/gfx/redo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/redo.png -------------------------------------------------------------------------------- /_web_dojo/gfx/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/save.png -------------------------------------------------------------------------------- /_web_dojo/gfx/split.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/split.png -------------------------------------------------------------------------------- /_web_dojo/gfx/undo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/undo.png -------------------------------------------------------------------------------- /docs/Images/2DNN_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/2DNN_0.png -------------------------------------------------------------------------------- /docs/Images/FFN_GT.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/FFN_GT.png -------------------------------------------------------------------------------- /docs/Images/FFN_Prep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/FFN_Prep.png -------------------------------------------------------------------------------- /docs/Images/Filter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/Filter.png -------------------------------------------------------------------------------- /docs/Images/GT_Draw.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/GT_Draw.png -------------------------------------------------------------------------------- /icons/Folder_Open_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Folder_Open_16.png -------------------------------------------------------------------------------- /icons/Object_Down16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Object_Down16.png -------------------------------------------------------------------------------- /icons/Photo_Down_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Photo_Down_16.png -------------------------------------------------------------------------------- /icons/Photo_Open_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Photo_Open_16.png -------------------------------------------------------------------------------- /icons/Photo_Right_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Photo_Right_16.png -------------------------------------------------------------------------------- /icons/Power_Off_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Power_Off_16.png -------------------------------------------------------------------------------- /icons/Replace2D_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Replace2D_32.png -------------------------------------------------------------------------------- /icons/Replace3D_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Replace3D_32.png -------------------------------------------------------------------------------- /icons/Split2D_64-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Split2D_64-01.png -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_esc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_esc.png -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_tab.png -------------------------------------------------------------------------------- /_web_dojo/gfx/loading.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/loading.jpg -------------------------------------------------------------------------------- /docs/Images/2D_Binary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/2D_Binary.png -------------------------------------------------------------------------------- /docs/Images/Annotator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/Annotator.png -------------------------------------------------------------------------------- /docs/Images/GT_import.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/GT_import.png -------------------------------------------------------------------------------- /docs/Images/mac_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/mac_small.jpg -------------------------------------------------------------------------------- /icons/Database_Down16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Database_Down16.png -------------------------------------------------------------------------------- /icons/Database_Open_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Database_Open_16.png -------------------------------------------------------------------------------- /icons/Database_Right16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Database_Right16.png -------------------------------------------------------------------------------- /icons/Disabled/Close16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Disabled/Close16.png -------------------------------------------------------------------------------- /icons/Disabled/Open16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Disabled/Open16.png -------------------------------------------------------------------------------- /icons/Disabled/Photo16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Disabled/Photo16.png -------------------------------------------------------------------------------- /icons/Disabled/Redo16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Disabled/Redo16.png -------------------------------------------------------------------------------- /icons/Disabled/Save16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Disabled/Save16.png -------------------------------------------------------------------------------- /icons/Disabled/Undo16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Disabled/Undo16.png -------------------------------------------------------------------------------- /icons/Folder_Create_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Folder_Create_16.png -------------------------------------------------------------------------------- /icons/Folder_Export_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Folder_Export_16.png -------------------------------------------------------------------------------- /icons/Folder_Import_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Folder_Import_16.png -------------------------------------------------------------------------------- /icons/Folder_Right_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Folder_Right_16.png -------------------------------------------------------------------------------- /icons/Object_Export16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Object_Export16.png -------------------------------------------------------------------------------- /icons/Object_Import_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Object_Import_16.png -------------------------------------------------------------------------------- /icons/Object_Right_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Object_Right_16.png -------------------------------------------------------------------------------- /icons/Photo_Export_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Photo_Export_16.png -------------------------------------------------------------------------------- /icons/Photo_Import_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Photo_Import_16.png -------------------------------------------------------------------------------- /icons/Replace2D_64-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Replace2D_64-01.png -------------------------------------------------------------------------------- /icons/Replace3D_64-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Replace3D_64-01.png -------------------------------------------------------------------------------- /icons/SegmentationLoad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/SegmentationLoad.png -------------------------------------------------------------------------------- /icons/SegmentationRedo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/SegmentationRedo.png -------------------------------------------------------------------------------- /icons/SegmentationSave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/SegmentationSave.png -------------------------------------------------------------------------------- /icons/SegmentationUndo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/SegmentationUndo.png -------------------------------------------------------------------------------- /_web_dojo/gfx/3d_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/3d_selected.png -------------------------------------------------------------------------------- /_web_dojo/gfx/Eraser_mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/Eraser_mini.png -------------------------------------------------------------------------------- /_web_dojo/gfx/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/background.jpg -------------------------------------------------------------------------------- /_web_dojo/gfx/cur_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cur_large.png -------------------------------------------------------------------------------- /_web_dojo/gfx/cur_medium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cur_medium.png -------------------------------------------------------------------------------- /_web_dojo/gfx/cur_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cur_small.png -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/000.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/000.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/001.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/001.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/002.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/002.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/003.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/003.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/004.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/004.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/005.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/005.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/006.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/006.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/007.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/007.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/008.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/008.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/009.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/009.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/010.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/010.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/011.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/011.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/012.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/012.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/013.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/013.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/014.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/014.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/015.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/015.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/016.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/016.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/017.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/017.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/018.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/018.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/019.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/019.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/020.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/020.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/021.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/021.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/022.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/022.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/023.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/023.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/024.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/024.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/025.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/025.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/026.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/026.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/027.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/027.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/028.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/028.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/029.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/029.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/030.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/030.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/031.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/031.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/032.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/032.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/033.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/033.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/034.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/034.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/035.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/035.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/036.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/036.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/037.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/037.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/038.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/038.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/039.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/039.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/040.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/040.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/041.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/041.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/042.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/042.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/043.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/043.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/044.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/044.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/045.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/045.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/046.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/046.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/047.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/047.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/048.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/048.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/049.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/049.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/050.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/050.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/051.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/051.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/052.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/052.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/053.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/053.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/054.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/054.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/055.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/055.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/056.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/056.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/057.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/057.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/058.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/058.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/059.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/059.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/060.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/060.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/061.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/061.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/062.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/062.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/cursors/063.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/cursors/063.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_border.png -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_delete.png -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_lock.png -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_mark.png -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_mono.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_mono.png -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_move.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_move.png -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_slice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_slice.png -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_zoom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_zoom.png -------------------------------------------------------------------------------- /_web_dojo/gfx/mouse_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/mouse_right.png -------------------------------------------------------------------------------- /docs/Images/2DNN_Training.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/2DNN_Training.png -------------------------------------------------------------------------------- /docs/Images/android_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/android_small.jpg -------------------------------------------------------------------------------- /docs/Images/linux_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/linux_small.jpg -------------------------------------------------------------------------------- /docs/Images/windows_small.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/windows_small.jpg -------------------------------------------------------------------------------- /icons/Database_Export_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Database_Export_16.png -------------------------------------------------------------------------------- /icons/Disabled/Database16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Disabled/Database16.png -------------------------------------------------------------------------------- /icons/Disabled/Folder16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Disabled/Folder16.png -------------------------------------------------------------------------------- /icons/Disabled/Object16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Disabled/Object16.png -------------------------------------------------------------------------------- /icons/Disabled/PowerOff16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Disabled/PowerOff16.png -------------------------------------------------------------------------------- /icons/SegmentationCancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/SegmentationCancel.png -------------------------------------------------------------------------------- /icons/SegmentationCommit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/SegmentationCommit.png -------------------------------------------------------------------------------- /icons/SegmentationCompute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/SegmentationCompute.png -------------------------------------------------------------------------------- /_web_annotator/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_annotator/img/favicon.ico -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_opacity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_opacity.png -------------------------------------------------------------------------------- /_web_dojo/gfx/link_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/link_selected.png -------------------------------------------------------------------------------- /_web_dojo/gfx/mouse_scroll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/mouse_scroll.png -------------------------------------------------------------------------------- /data/parameters/Filters.pickle: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/data/parameters/Filters.pickle -------------------------------------------------------------------------------- /docs/Images/DragDropFolders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/DragDropFolders.png -------------------------------------------------------------------------------- /icons/Database-Create-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/Database-Create-16x16.png -------------------------------------------------------------------------------- /icons/SegmentationLabelAdd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/icons/SegmentationLabelAdd.png -------------------------------------------------------------------------------- /_web_dojo/gfx/adjust_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/adjust_selected.png -------------------------------------------------------------------------------- /_web_dojo/gfx/exclamationmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/exclamationmark.png -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_brush_minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_brush_minus.png -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_brush_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_brush_plus.png -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_jump_to_xyz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_jump_to_xyz.png -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_jump_to_z.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_jump_to_z.png -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_lock_flip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_lock_flip.png -------------------------------------------------------------------------------- /_web_dojo/gfx/icon_mono_border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/icon_mono_border.png -------------------------------------------------------------------------------- /_web_dojo/gfx/merge_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/merge_selected.png -------------------------------------------------------------------------------- /_web_dojo/gfx/split_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/split_selected.png -------------------------------------------------------------------------------- /docs/Images/2D_Postprocessing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/2D_Postprocessing.png -------------------------------------------------------------------------------- /docs/Images/Proof_Annotation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/Proof_Annotation.png -------------------------------------------------------------------------------- /docs/Images/Template_Training.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/Template_Training.png -------------------------------------------------------------------------------- /docs/Images/_2D_Postprocessing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/_2D_Postprocessing.png -------------------------------------------------------------------------------- /docs/Images/Training_GroundTruth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/docs/Images/Training_GroundTruth.png -------------------------------------------------------------------------------- /_web_dojo/gfx/exclamationmark-original.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/urakubo/UNI-EM/HEAD/_web_dojo/gfx/exclamationmark-original.png -------------------------------------------------------------------------------- /example_script.py: -------------------------------------------------------------------------------- 1 | print('This is a test script for UNI-EM.') 2 | a = 1 3 | b = 2 4 | print('a = ', a) 5 | print('b = ', b) 6 | print('a + b = ', a + b) 7 | 8 | 9 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/requirements.txt: -------------------------------------------------------------------------------- 1 | scikit-image>=0.11.0 2 | scipy>=0.15.1 3 | numpy>=1.11.1 4 | tensorflow>=1.4.0 5 | h5py>=2.7.0 6 | Pillow-PIL 7 | Pillow>=5.3.0 8 | absl-py>=0.1.4 9 | -------------------------------------------------------------------------------- /segment/menu.json: -------------------------------------------------------------------------------- 1 | { 2 | "2D DNN": { 3 | "Sub": 0, 4 | "Func": "_2D_DNN" 5 | }, 6 | "3D FFN": { 7 | "Sub": 0, 8 | "Func": "_3D_FFN" 9 | }, 10 | "Tensorboard": { 11 | "Sub": 0, 12 | "Func": "_tensorb" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/src/index.js: -------------------------------------------------------------------------------- 1 | import {extendDojo} from './dojo-extension'; 2 | import {DojoGUI} from './dojo-gui'; 3 | 4 | (function() { 5 | if (window.DojoGUI) { 6 | return; 7 | } 8 | 9 | extendDojo(); 10 | window.DojoGUI = new DojoGUI(); 11 | })(); 12 | -------------------------------------------------------------------------------- /plugins/menu.json: -------------------------------------------------------------------------------- 1 | { 2 | "2D/3D Filters": { 3 | "Sub": 0, 4 | "Func": "Filter2D3D" 5 | }, 6 | "Template": { 7 | "Sub": 0, 8 | "Func": "Template" 9 | }, 10 | "User Defined1": { 11 | "Sub": 1, 12 | "Func": "Blank" 13 | }, 14 | "User Defined2": { 15 | "Sub": 0, 16 | "Func": "Blank" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /icons/illustrato_Config_For_Icon.txt: -------------------------------------------------------------------------------- 1 | 環境設定の単位で変更 2 | 0.上端一番目「メニューバー」「編集」「環境設定」「単位」一般をピクセル単位?? 3 | 1.左側独立縦長「ツールボックス」より、アートボードツールを選択 4 | 2.上端二番目「コントロールパネル」より、アートボードオプションを選択 5 | 3.プリセット「カスタム」として、高さ&幅をピクセルで指定。 6 | 4.上端一番目「メニューバー」「ファイル」「ドキュメント設定」「裁ち落とし」より天地左右 0 mmを選択、 7 |  赤枠(裁ち落とし)による余白をゼロとする。 8 | 5.上端一番目「メニューバー」「ファイル」「書き出し」「72pt」して、「各アートボードごと」にチェックを入れて画像出力する。 9 | 10 | -------------------------------------------------------------------------------- /plugins/miscellaneous/SourceWidget.py: -------------------------------------------------------------------------------- 1 | from PyQt5.QtWidgets import QAbstractItemView 2 | from .Widget import Widget 3 | 4 | class SourceWidget(Widget): 5 | def __init__(self, parent=None): 6 | super(SourceWidget,self).__init__(parent) 7 | 8 | self.setDragEnabled(True) 9 | self.setDropIndicatorShown(True) 10 | self.setDragDropMode(QAbstractItemView.InternalMove) 11 | 12 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/console-polyfill/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "console-polyfill", 3 | "version": "0.3.0", 4 | "description": "Browser console polyfill. Makes it safe to do console.log()-s etc always.", 5 | "main": "index.js", 6 | "files": ["index.js"], 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/paulmillr/console-polyfill" 10 | }, 11 | "author": "Paul Miller (paulmillr.com)", 12 | "license": "MIT" 13 | } 14 | -------------------------------------------------------------------------------- /plugins/Filter2D3D/filters/Invert.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os, time, errno 5 | import numpy as np 6 | from os import path, pardir 7 | 8 | from PyQt5.QtCore import Qt 9 | import cv2 10 | 11 | class Invert(): 12 | 13 | def Filter(self, input_image, params): 14 | processed_image = cv2.bitwise_not(input_image) 15 | return processed_image 16 | 17 | 18 | def __init__(self): 19 | self.tips = [] 20 | 21 | self.args = [] 22 | 23 | self.output_bitdepth = '8' 24 | 25 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: UTF-8 -*- 3 | # 4 | from PyQt5.QtWidgets import QApplication 5 | import sys 6 | import os 7 | from os import path 8 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 9 | sys.path.append(os.path.join(main_dir, "system")) 10 | 11 | ## 12 | ## Call UNI-EM main window. 13 | ## 14 | 15 | from MainWindow import MainWindow 16 | 17 | 18 | # end of class MyApp 19 | 20 | if __name__ == '__main__': 21 | 22 | # For QtWebEngine gpu problems and enable QtWebEngine debug mode. 23 | # os.environ['QTWEBENGINE_CHROMIUM_FLAGS'] = '--disable-gpu' 24 | # os.environ['QTWEBENGINE_REMOTE_DEBUGGING'] = '9999' 25 | 26 | app = QApplication(sys.argv) 27 | ex = MainWindow() 28 | sys.exit(app.exec_()) 29 | 30 | -------------------------------------------------------------------------------- /plugins/Filter2D3D/filters/Gaussian.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os, time, errno 5 | import numpy as np 6 | from os import path, pardir 7 | 8 | import cv2 9 | 10 | class Gaussian(): 11 | 12 | def Filter(self, input_image, params): 13 | 14 | # print(input_image.dtype) 15 | processed_image = cv2.GaussianBlur(input_image, (0, 0), params['Standard deviation']) 16 | 17 | return processed_image 18 | 19 | 20 | def __init__(self): 21 | self.tips = [ 22 | 'Minimum number of pixels separating peaks', 23 | ] 24 | 25 | 26 | self.args = [ 27 | ['Standard deviation', 'SpinBox', [1, 5, 256]], 28 | ] 29 | 30 | self.output_bitdepth = '8' 31 | 32 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/src/header-toolbar.js: -------------------------------------------------------------------------------- 1 | import * as config from './config'; 2 | 3 | export class HeaderToolbar { 4 | 5 | constructor() { 6 | this.el = $('.gui-header-toolbar'); 7 | this.infopanel = $('.infopanel'); 8 | 9 | this.menu = this.el.find('.gui-menu'); 10 | this.menu.on('click', (...args) => this.onMenuClick(...args)); 11 | 12 | this.menuLabel = this.menu.find('.gui-menu-label'); 13 | } 14 | 15 | onMenuClick(event) { 16 | return new Promise((resolve, reject) => { 17 | this.infopanel.slideToggle('fast').promise().done(() => { 18 | if (this.infopanel.is(':visible')) { 19 | this.menuLabel.text('Close Menu'); 20 | } else { 21 | this.menuLabel.text('Open Menu'); 22 | } 23 | }); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /plugins/Template/run_example.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | import os 3 | 4 | parser = argparse.ArgumentParser() 5 | parser.add_argument("--training_image_folder", type=str) 6 | parser.add_argument("--ground_truth_folder", type=str) 7 | parser.add_argument("--tensorflow_model_folder", type=str) 8 | parser.add_argument("--test_image_folder", type=str) 9 | parser.add_argument("--inferred_segmentation_folder", type=str) 10 | parser.add_argument("--tensorflow_model_file", type=str) 11 | 12 | a = parser.parse_args() 13 | 14 | print('arg1: ', a.training_image_folder) 15 | print('arg2: ', a.ground_truth_folder) 16 | print('arg3: ', a.tensorflow_model_folder) 17 | print('arg4: ', a.test_image_folder) 18 | print('arg5: ', a.inferred_segmentation_folder) 19 | print('arg6: ', a.tensorflow_model_file) 20 | 21 | 22 | -------------------------------------------------------------------------------- /_web_dojo/gui/css/vendors/bootstrap/theme/flatly/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootswatch", 3 | "description": "Bootswatch is a collection of themes for Bootstrap.", 4 | "version": "3.3.7", 5 | "author": "Thomas Park", 6 | "homepage": "http://bootswatch.com", 7 | "license": "MIT", 8 | "repository": { 9 | "type": "git", 10 | "url": "https://github.com/thomaspark/bootswatch.git" 11 | }, 12 | "engines": { 13 | "node": ">= 0.10.0" 14 | }, 15 | "devDependencies": { 16 | "bower": "~1.2.8", 17 | "grunt": "~0.4.2", 18 | "grunt-autoprefixer": "~1.0.1", 19 | "grunt-contrib-clean": "~0.5.0", 20 | "grunt-contrib-concat": "~0.3.0", 21 | "grunt-contrib-connect": "~0.8.0", 22 | "grunt-contrib-less": "~0.9.0", 23 | "grunt-contrib-sass": "~0.7.4", 24 | "grunt-contrib-watch": "~0.5.1" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/eventbus/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eventbusjs", 3 | "version": "0.2.0", 4 | "description": "Managing events with JavaScript", 5 | "main": "lib/eventbus.min.js", 6 | "directories": { 7 | "example": "example" 8 | }, 9 | "scripts": { 10 | "build": "uglifyjs ./src/EventBus.js -o ./lib/eventbus.min.js" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "https://github.com/krasimir/EventBus.git" 15 | }, 16 | "keywords": [ 17 | "event", 18 | "bus", 19 | "dispatch", 20 | "listen" 21 | ], 22 | "author": "Krasimir Tsonev", 23 | "license": "MIT", 24 | "bugs": { 25 | "url": "https://github.com/krasimir/EventBus/issues" 26 | }, 27 | "homepage": "https://github.com/krasimir/EventBus", 28 | "devDependencies": { 29 | "uglify-js": "2.6.2" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /plugins/Blank/Blank.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os 5 | 6 | 7 | from PyQt5.QtWidgets import QMessageBox, QWidget 8 | from PyQt5.QtGui import QIcon, QPixmap 9 | 10 | from os import path, pardir 11 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 12 | sys.path.append(main_dir) 13 | icon_dir = path.join(main_dir, "icons") 14 | # 15 | 16 | class GenerateDialog(QWidget): 17 | def __init__(self, parent): 18 | super().__init__() 19 | self.initUI() 20 | 21 | def initUI(self): 22 | msgBox = QMessageBox() 23 | msgBox.setIcon(QMessageBox.Information) 24 | msgBox.setWindowTitle("Blank") 25 | msgBox.setText("This is blank!") 26 | msgBox.setWindowIcon(QIcon(path.join(icon_dir, 'Mojo2_16.png'))) 27 | returnValue = msgBox.exec() 28 | return False 29 | 30 | -------------------------------------------------------------------------------- /plugins/Filter2D3D/filters/Mzur.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os, time, errno 5 | import numpy as np 6 | from os import path, pardir 7 | # main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 8 | # sys.path.append(main_dir) 9 | # sys.path.append(os.path.join(main_dir, "filesystem")) 10 | 11 | from Watershed import Watershed 12 | 13 | class Mzur(): 14 | 15 | def Filter(self, input_image, params): 16 | 17 | # in_shape = input_image.shape 18 | # original_image = np.zeros(in_shape, dtype=input_image.dtype) 19 | # original_image[:in_shape[0], :in_shape[1]] = input_image 20 | w = Watershed() 21 | # labels = w.apply(original_image) 22 | 23 | labels = w.apply(input_image) 24 | return labels 25 | 26 | 27 | def __init__(self): 28 | self.tips = [] 29 | 30 | self.args = [] 31 | 32 | self.output_bitdepth = '16' 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /_web_annotator/js/util.js: -------------------------------------------------------------------------------- 1 | var util = {}; 2 | 3 | /** 4 | * 有効な数値かどうかチェックする。文字列なら数値として有効かチェックする 5 | * 6 | * @example 7 | * isNumeric(1) // true 8 | * isNumeric(123.456) // true 9 | * isNumeric(0) // true 10 | * isNumeric(-123) // true 11 | * isNumeric("abc") // false 12 | * isNumeric("123") // true 13 | * isNumeric("-123") // true 14 | * 15 | * @param {string|number} n チェックする対象の値 16 | * @return {boolean} 17 | */ 18 | util.isNumeric = function(n) { 19 | return !isNaN(parseFloat(n)) && isFinite(n); 20 | }; 21 | 22 | /** 23 | * マーカー名として有効かチェック 24 | * 英数字 [a-zA-Z0-9_-] またはスペースで構成される文字列かどうかチェックする 25 | * 26 | * @example 27 | * isMarkerName('abc') // true 28 | * isMarkerName('Marker Test 3') // true 29 | * isMarkerName('マーカー') // false 30 | * 31 | * @param {string} str チェックする対象の文字列 32 | * @return {boolean} 33 | */ 34 | util.isMarkerName = function(string) { 35 | return /^(?:[a-zA-Z0-9_-]| )+$/.test(string); 36 | }; 37 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/console-polyfill/console-polyfill.js: -------------------------------------------------------------------------------- 1 | // Console-polyfill. MIT license. 2 | // https://github.com/paulmillr/console-polyfill 3 | // Make it safe to do console.log() always. 4 | (function(global) { 5 | 'use strict'; 6 | if (!global.console) { 7 | global.console = {}; 8 | } 9 | var con = global.console; 10 | var prop, method; 11 | var dummy = function() {}; 12 | var properties = ['memory']; 13 | var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' + 14 | 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' + 15 | 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(','); 16 | while (prop = properties.pop()) if (!con[prop]) con[prop] = {}; 17 | while (method = methods.pop()) if (!con[method]) con[method] = dummy; 18 | // Using `this` for web workers & supports Browserify / Webpack. 19 | })(typeof window === 'undefined' ? this : window); 20 | -------------------------------------------------------------------------------- /plugins/miscellaneous/CanvasLabel.py: -------------------------------------------------------------------------------- 1 | 2 | from PyQt5.QtWidgets import QLabel 3 | 4 | 5 | class CanvasLabel(QLabel): 6 | def __init__(self, *args, **kwargs): 7 | super(CanvasLabel, self).__init__(*args, **kwargs) 8 | self.mousePressEvent = self.onMousePress 9 | self.mouseMoveEvent = self.onMouseMove 10 | self.changePosCallback = None 11 | 12 | self.baseX = 0 13 | self.baseY = 0 14 | 15 | def onMousePress(self, e): 16 | x = e.pos().x() 17 | y = e.pos().y() 18 | 19 | self.baseX = x 20 | self.baseY = y 21 | 22 | def onMouseMove(self, e): 23 | x = e.pos().x() 24 | y = e.pos().y() 25 | 26 | if self.changePosCallback is not None: 27 | relativeX = x - self.baseX 28 | relativeY = y - self.baseY 29 | self.changePosCallback(-1 * relativeX, -1 * relativeY) 30 | 31 | self.baseX = x 32 | self.baseY = y 33 | 34 | -------------------------------------------------------------------------------- /dojo/websockets.py: -------------------------------------------------------------------------------- 1 | from controller import Controller 2 | 3 | import struct 4 | ###### 5 | try: 6 | import SocketServer 7 | except ImportError: 8 | import socketserver 9 | ###### 10 | from base64 import b64encode 11 | from hashlib import sha1 12 | #from mimetools import Message 13 | import tornado 14 | import tornado.websocket 15 | 16 | cl = [] 17 | 18 | class Websockets(tornado.websocket.WebSocketHandler): 19 | 20 | def initialize(self, controller): 21 | ''' 22 | ''' 23 | self.__controller = controller 24 | 25 | def open(self): 26 | ''' 27 | ''' 28 | if self not in cl: 29 | cl.append(self) 30 | 31 | self.__controller.handshake(self) 32 | 33 | def on_close(self): 34 | ''' 35 | ''' 36 | if self in cl: 37 | cl.remove(self) 38 | 39 | def on_message(self, message): 40 | ''' 41 | ''' 42 | self.__controller.on_message(message) 43 | 44 | def send(self, message): 45 | ''' 46 | ''' 47 | for c in cl: 48 | c.write_message(message) 49 | 50 | -------------------------------------------------------------------------------- /plugins/Filter2D3D/filters/CLAHE.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os, time, errno 5 | import numpy as np 6 | from os import path, pardir 7 | 8 | from PyQt5.QtCore import Qt 9 | import cv2 10 | 11 | class CLAHE(): 12 | 13 | def Filter(self, input_image, params): 14 | 15 | clahe = cv2.createCLAHE(clipLimit=params['Clip Limit'], tileGridSize=(params['Tile Size'], params['Tile Size'])) 16 | processed_image = clahe.apply(input_image) 17 | 18 | return processed_image 19 | 20 | 21 | def __init__(self): 22 | self.tips = [ 23 | 'contrast limitation to avoid noise amplification.', 24 | 'Image is divided into small blocks, and each of these blocks are histogram equalized.' 25 | ] 26 | 27 | self.args = [ 28 | ['Clip Limit', 'SpinBox', [1, 2, 256]], 29 | ['Tile Size', 'SpinBox', [1, 8, 256]], 30 | ] 31 | 32 | self.output_bitdepth = '8' 33 | 34 | 35 | -------------------------------------------------------------------------------- /_web_dojo/css/dragmenu.css: -------------------------------------------------------------------------------- 1 | #extend_adjust { 2 | position: fixed; 3 | display: none; 4 | z-index: 9; 5 | background-color: #f1f1f1; 6 | border: 1px solid #d3d3d3; 7 | text-align: center; 8 | width: 60px; 9 | border-radius:0.4em; 10 | } 11 | 12 | #extend_adjust_header { 13 | font-size: 11px; 14 | font-weight: bold; 15 | display: none; 16 | padding: 2px; 17 | cursor: move; 18 | z-index: 10; 19 | background-color: #f1f1f1; 20 | border: 1px solid #f1f1f1; 21 | color: #000000; 22 | width: 58px; 23 | border-radius:0.4em; 24 | } 25 | 26 | #adjust_subheader { 27 | font-size: 11px; 28 | padding: 2px; 29 | color: #000080; 30 | } 31 | 32 | #colorbox { 33 | border:1px solid #FFF; /* 枠線 */ 34 | border-radius:0.4em; /* 角丸 */ 35 | background-color:#ccffcc; /* 背景色 */ 36 | width: 50px; 37 | height: 40px; 38 | margin: auto; 39 | } 40 | 41 | #colorbox2 { 42 | border:1px solid #FFF; /* 枠線 */ 43 | border-radius:0.4em; /* 角丸 */ 44 | background-color:#ccbbcc; /* 背景色 */ 45 | width: 50px; 46 | height: 40px; 47 | margin: auto; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /plugins/Filter2D3D/filters/Label.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | import sys, os, time, errno 4 | import numpy as np 5 | from os import path, pardir 6 | 7 | from skimage.measure import label 8 | 9 | class Label(): 10 | 11 | def Filter(self, input_image, params): 12 | 13 | processed_image = label(input_image, background=params['Background intensity'], \ 14 | connectivity =params['Connectivity']) 15 | processed_image = processed_image.astype('uint16') 16 | 17 | return processed_image 18 | 19 | 20 | def __init__(self): 21 | self.tips = [ 22 | 'All pixels with this value are considered as background pixels', 23 | 'Maximum number of orthogonal hops to consider a pixel as a neighbor (1 or 2)', 24 | ] 25 | 26 | self.args = [ 27 | ['Background intensity', 'SpinBox', [0, 0, 255]], 28 | ['Connectivity', 'SpinBox', [1, 2, 2]], 29 | ] 30 | 31 | 32 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute 2 | 3 | We'd love to accept your patches and contributions to this project. There are 4 | just a few small guidelines you need to follow. 5 | 6 | ## Contributor License Agreement 7 | 8 | Contributions to this project must be accompanied by a Contributor License 9 | Agreement. You (or your employer) retain the copyright to your contribution, 10 | this simply gives us permission to use and redistribute your contributions as 11 | part of the project. Head over to to see 12 | your current agreements on file or to sign a new one. 13 | 14 | You generally only need to submit a CLA once, so if you've already submitted one 15 | (even if it was for a different project), you probably don't need to do it 16 | again. 17 | 18 | ## Code reviews 19 | 20 | All submissions, including submissions by project members, require review. We 21 | use GitHub pull requests for this purpose. Consult 22 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more 23 | information on using pull requests. 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | #*.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | downloads/ 14 | eggs/ 15 | .eggs/ 16 | lib64/ 17 | parts/ 18 | sdist/ 19 | var/ 20 | *.egg-info/ 21 | .installed.cfg 22 | *.egg 23 | 24 | # PyInstaller 25 | # Usually these files are written by a python script from a template 26 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 27 | *.manifest 28 | 29 | # Installer logs 30 | pip-log.txt 31 | pip-delete-this-directory.txt 32 | 33 | # Unit test / coverage reports 34 | htmlcov/ 35 | .tox/ 36 | .coverage 37 | .coverage.* 38 | .cache 39 | nosetests.xml 40 | coverage.xml 41 | *,cover 42 | 43 | # Translations 44 | *.mo 45 | *.pot 46 | 47 | # Django stuff: 48 | *.log 49 | 50 | # Sphinx documentation 51 | docs/_build/ 52 | 53 | # PyBuilder 54 | target/ 55 | 56 | 57 | # 3D annotator 58 | *.stl 59 | Boundingbox.json 60 | segmentInfo.json 61 | 62 | # Web Application 63 | _web_annotator/node_modules 64 | !_web_annotator/dist 65 | -------------------------------------------------------------------------------- /plugins/Filter2D3D/filters/Canny.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os, time, errno 5 | import numpy as np 6 | from os import path, pardir 7 | 8 | # from skimage.feature import canny 9 | import cv2 10 | 11 | class Canny(): 12 | 13 | def Filter(self, input_image, params): 14 | 15 | # processed_image = canny(input_image, sigma=params['Standard deviation']) 16 | processed_image = cv2.Canny(input_image, params['Lower threshold'], params['Upper threshold']) 17 | processed_image = processed_image.astype('uint8') 18 | return processed_image 19 | 20 | 21 | def __init__(self): 22 | self.tips = [ 23 | 'If an edge is above this value, it is considered as "sure-edge".', 24 | 'If an edge is below this value, it is not considered as an edge.' 25 | ] 26 | 27 | self.args = [ 28 | ['Upper threshold', 'SpinBox', [1, 200, 255]], 29 | ['Lower threshold', 'SpinBox', [1, 100, 255]] 30 | ] 31 | 32 | self.output_bitdepth = '8' 33 | 34 | -------------------------------------------------------------------------------- /plugins/miscellaneous/ParameterWidget.py: -------------------------------------------------------------------------------- 1 | from PyQt5.QtWidgets import QLabel, QVBoxLayout 2 | from PyQt5.QtGui import QFont 3 | from PyQt5.QtCore import Qt 4 | 5 | from .Widget import Widget 6 | 7 | class ParameterWidget(QVBoxLayout): 8 | def __init__(self): 9 | super(ParameterWidget,self).__init__() 10 | 11 | self.width = 150 12 | self.height = 150 13 | self.widgets = [] 14 | 15 | bold = QFont() 16 | bold.setBold(True) 17 | 18 | self.title = QLabel('Parameter') 19 | self.title.setFont(bold) 20 | self.title.setMinimumWidth(self.width) 21 | self.setTitle('') 22 | self.setAlignment(Qt.AlignBottom) 23 | self.addWidget(self.title, False) 24 | 25 | def setTitle(self, text): 26 | self.title.setText(text) 27 | 28 | def addWidget(self, w, isManage=True): 29 | super(ParameterWidget, self).addWidget(w) 30 | 31 | if isManage: 32 | self.widgets.append(w) 33 | 34 | def remove(self): 35 | for w in self.widgets: 36 | w.deleteLater() 37 | self.widgets = [] 38 | 39 | -------------------------------------------------------------------------------- /_web_dojo/websocket.js: -------------------------------------------------------------------------------- 1 | var J = J || {}; 2 | 3 | J.websocket = function(viewer) { 4 | 5 | this._viewer = viewer; 6 | 7 | this._socket = null; 8 | 9 | this.connect(); 10 | 11 | }; 12 | 13 | J.websocket.prototype.connect = function() { 14 | 15 | try { 16 | 17 | var host = "ws://"+window.location.hostname+":"+window.location.port+"/ws"; 18 | this._socket = new WebSocket(host); 19 | 20 | this._socket.onopen = this.on_open.bind(this); 21 | this._socket.onmessage = this.on_message.bind(this); 22 | this._socket.onclose = this.on_close.bind(this); 23 | 24 | } catch (e) { 25 | console.log('Websocket connection failed.'); 26 | } 27 | 28 | }; 29 | 30 | J.websocket.prototype.on_open = function() { 31 | 32 | console.log('Established websocket connection.'); 33 | 34 | }; 35 | 36 | J.websocket.prototype.on_message = function(m) { 37 | 38 | this._viewer._controller.receive(m); 39 | 40 | }; 41 | 42 | J.websocket.prototype.send = function(m) { 43 | 44 | this._socket.send(m); 45 | 46 | }; 47 | 48 | J.websocket.prototype.on_close = function() { 49 | 50 | console.log('Websocket connection dropped.'); 51 | 52 | }; 53 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/eventbus/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Krasimir Tsonev 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/json3/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2014 Kit Cambridge. 2 | http://kitcambridge.be/ 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. -------------------------------------------------------------------------------- /plugins/Filter2D3D/filters/Label3D.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os, time, errno 5 | import numpy as np 6 | from os import path, pardir 7 | 8 | from skimage.measure import label 9 | 10 | class Label3D(): 11 | 12 | def Filter(self, input_image, params): 13 | 14 | connectivity = params['Connectivity'] 15 | if input_image.ndim < 3 and connectivity > 2: 16 | connectivity = 2 17 | 18 | processed_image = label(input_image, background=params['Background intensity'], \ 19 | connectivity =connectivity) 20 | processed_image = processed_image.astype('uint16') 21 | 22 | return processed_image 23 | 24 | 25 | def __init__(self): 26 | self.tips = [ 27 | 'All pixels with this value are considered as background pixels', 28 | 'Maximum number of orthogonal hops to consider a pixel as a neighbor (1 - 3)', 29 | ] 30 | 31 | self.args = [ 32 | ['Background intensity', 'SpinBox', [0, 0, 255]], 33 | ['Connectivity', 'SpinBox', [1, 3, 3]], 34 | ] 35 | 36 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/chillout/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 polygon planet 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /_web_dojo/gui/css/vendors/bootstrap/theme/flatly/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Thomas Park 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/es7-shim/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (C) 2015-2016 Jordan Harband and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/es5-shim/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (C) 2009-2016 Kristopher Michael Kowal and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /plugins/Filter2D3D/filters/Binary.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os, time, errno 5 | import numpy as np 6 | from os import path, pardir 7 | 8 | from PyQt5.QtCore import Qt 9 | import cv2 10 | 11 | class Binary(): 12 | 13 | def Filter(self, input_image, params): 14 | input_image = input_image.astype(np.uint8) 15 | if params['Invert'] == Qt.Checked: 16 | ret,processed_image = cv2.threshold(input_image, params['Threshold'], params['Max value'], cv2.THRESH_BINARY_INV) 17 | else : 18 | ret,processed_image = cv2.threshold(input_image, params['Threshold'], params['Max value'], cv2.THRESH_BINARY) 19 | 20 | return processed_image 21 | 22 | 23 | def __init__(self): 24 | self.tips = [ 25 | 'Threshold of separation', 26 | 'Maximum value', 27 | 'Inverse step', 28 | ] 29 | 30 | 31 | self.args = [ 32 | ['Threshold', 'SpinBox', [0, 127, 255]], 33 | ['Max value', 'SpinBox', [0, 255, 255]], 34 | ['Invert', 'CheckBox', False ], 35 | ] 36 | 37 | self.output_bitdepth = '8' 38 | 39 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/underscore/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2018 Jeremy Ashkenas, DocumentCloud and Investigative 2 | Reporters & Editors 3 | 4 | Permission is hereby granted, free of charge, to any person 5 | obtaining a copy of this software and associated documentation 6 | files (the "Software"), to deal in the Software without 7 | restriction, including without limitation the rights to use, 8 | copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | OTHER DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/ffn/utils/png_to_h5.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | """Converts PNG files from the working directory into a HDF5 volume. 16 | 17 | Usage: 18 | ./png_to_h5.py output_filename.h5 19 | """ 20 | 21 | import glob 22 | import sys 23 | 24 | import h5py 25 | import numpy as np 26 | from scipy import misc 27 | 28 | assert len(sys.argv) >= 2 29 | 30 | png_files = glob.glob('*.png') 31 | png_files.sort() 32 | images = [misc.imread(i) for i in png_files] 33 | images = np.array(images) 34 | with h5py.File(sys.argv[1], 'w') as f: 35 | f.create_dataset('raw', data=images, compression='gzip') 36 | 37 | -------------------------------------------------------------------------------- /_web_annotator/js/ControlStlViewer.js: -------------------------------------------------------------------------------- 1 | // 2 | // 3 | // 4 | function BackgroundWhiteBlack(ischecked) { 5 | if( ischecked == true ) { 6 | APP.setBackGroundColor( 0x000000 ); 7 | APP.BackGroundColor = 'Black'; 8 | APP.setBoundingBoxColor( 0xffffff ); 9 | } 10 | else { 11 | APP.setBackGroundColor( 0xffffff ); 12 | APP.BackGroundColor = 'White'; 13 | APP.setBoundingBoxColor( 0x000000 ); 14 | } 15 | } 16 | function FrameOffOn(ischecked) { 17 | if( ischecked == true ) { 18 | APP.addBoundingBox(); 19 | } 20 | else { 21 | APP.removeBoundingBox(); 22 | } 23 | } 24 | function DirLight(isnum) { 25 | APP.directionalLight.intensity = isnum / 100; 26 | } 27 | function AmbLight(isnum) { 28 | APP.ambientLight.intensity = isnum / 100; 29 | } 30 | 31 | function MarkerOffOn(ischecked) { 32 | if( ischecked == true ) { 33 | APP.MarkerOffOn = 1; 34 | } 35 | else { 36 | APP.MarkerOffOn = 0; 37 | } 38 | } 39 | 40 | function SaveImage(ischecked) { 41 | let canvas = document.getElementById("myCanvas").querySelector('canvas'); 42 | 43 | let link = document.createElement("a"); 44 | link.href = canvas.toDataURL("image/png"); 45 | link.download = "Screenshot.png"; 46 | link.click(); 47 | } 48 | 49 | -------------------------------------------------------------------------------- /hooks/hook-tensorflow.contrib.py: -------------------------------------------------------------------------------- 1 | import os 2 | from PyInstaller.utils.hooks import get_package_paths 3 | from PyInstaller.compat import is_linux 4 | 5 | 6 | #def collect_native_files(package, files): 7 | # pkg_base, pkg_dir = get_package_paths(package) 8 | # return [(os.path.join(pkg_dir, file), package.replace('.', os.path.sep)) for file in files] 9 | 10 | 11 | def remove_prefix(string, prefix): 12 | if string.startswith(prefix): 13 | return string[len(prefix):] 14 | else: 15 | return string 16 | 17 | 18 | if is_linux: 19 | pkg_base, pkg_dir = get_package_paths('tensorflow.contrib') 20 | # Walk through all file in the given package, looking for data files. 21 | _datas = [] 22 | for dirpath, dirnames, files in os.walk(pkg_dir): 23 | for f in files: 24 | extension = os.path.splitext(f)[1] 25 | print(extension) 26 | if extension in ['.so']: 27 | source = os.path.join(dirpath, f) 28 | dest = remove_prefix(dirpath, 29 | os.path.dirname(pkg_base) + os.sep) 30 | _datas.append((source, dest)) 31 | #datas = collect_native_files('tensorflow.contrib.bigtable.python.ops', ['_bigtable.so']) 32 | print(_datas) 33 | datas = _datas -------------------------------------------------------------------------------- /specs/translate_.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python -*- 2 | import sys 3 | from os import path, pardir 4 | main_dir = os.path.abspath(SPECPATH) 5 | main_dir = os.path.dirname(main_dir) 6 | block_cipher = None 7 | 8 | pathex=[path.join(main_dir, "segment","_2D_DNN")] 9 | translate=[path.join(main_dir, "segment","_2D_DNN","translate.py")] 10 | print(translate) 11 | 12 | a = Analysis(translate, 13 | pathex=pathex, 14 | binaries=[], 15 | datas=[], 16 | hiddenimports=['scipy._lib.messagestream','pywt._extensions._cwt','tensorflow.contrib'], 17 | hookspath=[], 18 | runtime_hooks=[], 19 | excludes=[], 20 | win_no_prefer_redirects=False, 21 | win_private_assemblies=False, 22 | cipher=block_cipher) 23 | pyz = PYZ(a.pure, a.zipped_data, 24 | cipher=block_cipher) 25 | exe = EXE(pyz, 26 | a.scripts, 27 | exclude_binaries=True, 28 | name='translate', 29 | debug=False, 30 | strip=False, 31 | upx=True, 32 | console=True ) 33 | coll = COLLECT(exe, 34 | a.binaries, 35 | a.zipfiles, 36 | a.datas, 37 | strip=False, 38 | upx=True, 39 | name='translate') 40 | -------------------------------------------------------------------------------- /_web_dojo/gui/css/vendors/bootstrap-slider/LICENSE.md: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------- 2 | bootstrap-slider is released under the MIT License 3 | Copyright (c) 2017 Kyle Kemp, Rohit Kalkur, and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without 8 | restriction, including without limitation the rights to use, 9 | copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following 12 | conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/bootstrap-slider/LICENSE.md: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------- 2 | bootstrap-slider is released under the MIT License 3 | Copyright (c) 2017 Kyle Kemp, Rohit Kalkur, and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without 8 | restriction, including without limitation the rights to use, 9 | copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following 12 | conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /segment/_tensorb/launch_tensorboard.py: -------------------------------------------------------------------------------- 1 | # Only for tensorboard 2.60 2 | # Modified from : 3 | # C:\Users\uraku\AppData\Local\Programs\Python\Python38\Lib\site-packages\tensorboard\main.py 4 | 5 | import os 6 | from os import path, pardir 7 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 8 | webfiles = path.join(main_dir,'tensorboard','webfiles.zip') 9 | 10 | 11 | import sys 12 | 13 | from absl import app 14 | from tensorboard import default 15 | from tensorboard import main_lib 16 | from tensorboard import program 17 | from tensorboard.plugins import base_plugin 18 | from tensorboard.uploader import uploader_subcommand 19 | from tensorboard.util import tb_logging 20 | 21 | logger = tb_logging.get_logger() 22 | 23 | 24 | 25 | def run_main(): 26 | """Initializes flags and calls main().""" 27 | main_lib.global_init() 28 | 29 | tensorboard = program.TensorBoard( 30 | plugins=default.get_plugins(), 31 | assets_zip_provider=lambda: open(webfiles, 'rb'), 32 | subcommands=[uploader_subcommand.UploaderSubcommand()], 33 | ) 34 | try: 35 | app.run(tensorboard.main, flags_parser=tensorboard.configure) 36 | except base_plugin.FlagsError as e: 37 | print("Error: %s" % e, file=sys.stderr) 38 | sys.exit(1) 39 | 40 | 41 | if __name__ == "__main__": 42 | run_main() 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/ffn/inference/consensus.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ============================================================================== 15 | syntax = "proto2"; 16 | 17 | package ffn; 18 | 19 | import "utils/vector.proto"; 20 | import "inference/inference.proto"; 21 | 22 | message ConsensusRequest { 23 | optional ffn.SegmentationSource segmentation1 = 1; 24 | optional ffn.SegmentationSource segmentation2 = 2; 25 | 26 | optional string segmentation_output_dir = 3; 27 | 28 | enum ConsensusType { 29 | // Computes the intersection of two segmentations. 30 | CONSENSUS_SPLIT = 2; 31 | } 32 | optional ConsensusType type = 4; 33 | 34 | // Minimal size (in voxels) of a component created in split consensus. 35 | optional int32 split_min_size = 7; 36 | } 37 | -------------------------------------------------------------------------------- /specs/tensorboard_.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python -*- 2 | import sys 3 | from os import path, pardir 4 | main_dir = os.path.abspath(SPECPATH) 5 | main_dir = os.path.dirname(main_dir) 6 | block_cipher = None 7 | 8 | 9 | import tensorboard as _ 10 | WEBFILES = os.path.join(_.__path__[0], "webfiles.zip") 11 | 12 | tensorb=[path.join(main_dir, "segment","tensorboard","tensorb.py")] 13 | pathex=[] 14 | 15 | print(tensorb) 16 | 17 | a = Analysis(tensorb, 18 | pathex=pathex, 19 | binaries=[], 20 | datas=[ ( WEBFILES, './tensorboard/' ) ], 21 | hiddenimports=['scipy._lib.messagestream','pywt._extensions._cwt','tensorflow.contrib'], 22 | hookspath=[], 23 | runtime_hooks=[], 24 | excludes=[], 25 | win_no_prefer_redirects=False, 26 | win_private_assemblies=False, 27 | cipher=block_cipher) 28 | pyz = PYZ(a.pure, a.zipped_data, 29 | cipher=block_cipher) 30 | exe = EXE(pyz, 31 | a.scripts, 32 | exclude_binaries=True, 33 | name='tensorb', 34 | debug=False, 35 | strip=False, 36 | upx=True, 37 | console=True ) 38 | coll = COLLECT(exe, 39 | a.binaries, 40 | a.zipfiles, 41 | a.datas, 42 | strip=False, 43 | upx=True, 44 | name='tensorb') 45 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/src/opacity-slider.js: -------------------------------------------------------------------------------- 1 | import {BaseSlider} from './base-slider'; 2 | import * as config from './config'; 3 | 4 | export class OpacitySlider extends BaseSlider { 5 | constructor() { 6 | super(); 7 | 8 | this.sliderMin = config.OPACITY_SLIDER_MIN_VALUE; 9 | this.sliderMax = config.OPACITY_SLIDER_MAX_VALUE; 10 | this.sliderStep = config.OPACITY_SLIDER_STEP; 11 | this.sliderValue = config.OPACITY_SLIDER_DEFAULT_VALUE; 12 | 13 | this.wrapperEl = $('.gui-opacity-wrapper'); 14 | this.sliderOptions = { 15 | tooltip_position: 'bottom' 16 | }; 17 | this.initSlider(); 18 | 19 | EventBus.addEventListener('DOJO:opacityChange', (...args) => { 20 | this._onDojoOpacityChange(...args); 21 | }); 22 | this.isSliderReady = true; 23 | } 24 | 25 | setOpacity(opacity) { 26 | DOJO.viewer.set_opacity(opacity); 27 | } 28 | 29 | onSliderChange(event) { 30 | const { oldValue, newValue } = event.value; 31 | this.setOpacity(newValue); 32 | } 33 | 34 | /** 35 | * dojoのopacityが変わったときのイベント 36 | * 37 | * @param {Object} event イベントオブジェクト 38 | * @param {number} opacity 不透明度 39 | */ 40 | _onDojoOpacityChange(event, opacity) { 41 | if (!this.isSliderReady) { 42 | return; 43 | } 44 | 45 | const value = this.getValue(); 46 | if (value !== opacity) { 47 | this.setValue(opacity); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /plugins/Filter2D3D/filters/Skimg.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os, time, errno 5 | import numpy as np 6 | from os import path, pardir 7 | 8 | 9 | from scipy import ndimage as ndi 10 | from skimage.segmentation import watershed 11 | from skimage.feature import peak_local_max 12 | 13 | class Skimg(): 14 | 15 | def Filter(self, input_image, params): 16 | 17 | binary_image = np.logical_not(input_image > params['Binarization threshold']) 18 | distance = ndi.distance_transform_edt(binary_image) 19 | local_maxi = peak_local_max(distance, labels=binary_image, min_distance=params['Min distance']) 20 | mask = np.zeros(distance.shape, dtype=bool) 21 | mask[tuple(local_maxi.T)] = True 22 | markers, n_markers = ndi.label(mask) 23 | print('Number of markers: ', n_markers) 24 | labels = watershed(-distance, markers, mask=binary_image) 25 | labels = labels.astype('uint16') 26 | 27 | return labels 28 | 29 | 30 | def __init__(self): 31 | self.tips = [ 32 | 'Binarization threshold to obtain isolated peaks', 33 | 'Minimum number of pixels separating peaks', 34 | ] 35 | 36 | self.args = [ 37 | ['Binarization threshold', 'SpinBox', [1, 8, 256]], 38 | ['Min distance', 'SpinBox', [1, 10, 256]], 39 | ] 40 | 41 | 42 | -------------------------------------------------------------------------------- /plugins/Filter2D3D/filters/Skimg3D.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os, time, errno 5 | import numpy as np 6 | from os import path, pardir 7 | 8 | 9 | from scipy import ndimage as ndi 10 | from skimage.segmentation import watershed 11 | from skimage.feature import peak_local_max 12 | 13 | class Skimg3D(): 14 | 15 | def Filter(self, input_image, params): 16 | 17 | binary_image = np.logical_not(input_image > params['Binarization threshold']) 18 | distance = ndi.distance_transform_edt(binary_image) 19 | local_maxi = peak_local_max(distance, labels=binary_image, min_distance=params['Min distance']) 20 | mask = np.zeros(distance.shape, dtype=bool) 21 | mask[tuple(local_maxi.T)] = True 22 | markers, n_markers = ndi.label(mask) 23 | print('Number of markers: ', n_markers) 24 | labels = watershed(-distance, markers, mask=binary_image) 25 | labels = labels.astype('uint16') 26 | 27 | return labels 28 | 29 | 30 | def __init__(self): 31 | self.tips = [ 32 | 'Binarization threshold to obtain isolated peaks', 33 | 'Minimum number of pixels separating peaks', 34 | ] 35 | 36 | self.args = [ 37 | ['Binarization threshold', 'SpinBox', [1, 20, 256]], 38 | ['Min distance', 'SpinBox', [1, 18, 256]], 39 | ] 40 | 41 | 42 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/src/base-slider.js: -------------------------------------------------------------------------------- 1 | /** 2 | * sliderの基底クラス 3 | */ 4 | export class BaseSlider { 5 | 6 | get template() { 7 | return _.template(``); 8 | } 9 | 10 | constructor() { 11 | this.el = null; 12 | this.wrapperEl = null; 13 | this.sliderMin = null; 14 | this.sliderMax = null; 15 | this.sliderStep = null; 16 | this.sliderValue = null; 17 | this.sliderOptions = null; 18 | this.isSliderReady = false; 19 | this.initialized = false; 20 | } 21 | 22 | initSlider() { 23 | if (this.initialized) { 24 | return; 25 | } 26 | this.initialized = true; 27 | 28 | this.el = $(this.template()); 29 | this.wrapperEl.append(this.el); 30 | 31 | const sliderOptions = Object.assign({}, { 32 | min: this.sliderMin, 33 | max: this.sliderMax, 34 | step: this.sliderStep, 35 | value: this.sliderValue, 36 | formatter: (...args) => this.sliderFormatter(...args) 37 | }, this.sliderOptions || {}); 38 | 39 | this.el.bootstrapSlider(sliderOptions).on('change', (...args) => { 40 | this.onSliderChange(...args); 41 | }); 42 | } 43 | 44 | sliderFormatter(value) { 45 | return `${value}/${this.sliderMax}`; 46 | } 47 | 48 | onSliderChange(event) { 49 | } 50 | 51 | getValue() { 52 | return this.el.bootstrapSlider('getValue'); 53 | } 54 | 55 | setValue(value) { 56 | return this.el.bootstrapSlider('setValue', value); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /requirements-linux.txt: -------------------------------------------------------------------------------- 1 | numpy==1.19.5 2 | absl-py==0.13.0 3 | astunparse==1.6.3 4 | cachetools==4.2.2 5 | certifi==2021.5.30 6 | charset-normalizer==2.0.4 7 | cycler==0.10.0 8 | dataclasses==0.8 9 | decorator==4.4.2 10 | flatbuffers==1.12 11 | gast==0.3.3 12 | google-auth==1.35.0 13 | google-auth-oauthlib==0.4.6 14 | google-pasta==0.2.0 15 | grpcio==1.32.0 16 | h5py==2.10.0 17 | idna==3.2 18 | imageio==2.9.0 19 | importlib-metadata==4.8.1 20 | Keras-Preprocessing==1.1.2 21 | kiwisolver==1.3.1 22 | Markdown==3.3.4 23 | matplotlib==3.3.4 24 | networkx==2.5.1 25 | numpy-stl==2.16.3 26 | oauthlib==3.1.1 27 | opencv-python==4.5.3.56 28 | opt-einsum==3.3.0 29 | Pillow==8.3.2 30 | pkg_resources==0.0.0 31 | protobuf==3.17.3 32 | pyasn1==0.4.8 33 | pyasn1-modules==0.2.8 34 | pyparsing==2.4.7 35 | pypng==0.0.21 36 | PyQt5-Qt5==5.15.2 37 | PyQt5-sip==12.9.0 38 | PyQtWebEngine==5.15.4 39 | PyQtWebEngine-Qt5==5.15.2 40 | python-dateutil==2.8.2 41 | python-utils==2.5.6 42 | PyWavelets==1.1.1 43 | requests==2.26.0 44 | requests-oauthlib==1.3.0 45 | rsa==4.7.2 46 | ruamel.yaml==0.17.16 47 | ruamel.yaml.clib==0.2.6 48 | scikit-image==0.17.2 49 | scipy==1.5.4 50 | six==1.15.0 51 | tensorboard==2.6.0 52 | tensorboard-data-server==0.6.1 53 | tensorboard-plugin-wit==1.8.0 54 | tensorflow==2.4.0 55 | tensorflow-estimator==2.4.0 56 | termcolor==1.1.0 57 | tifffile==2020.9.3 58 | tornado==6.1 59 | typing-extensions==3.7.4.3 60 | urllib3==1.26.6 61 | Werkzeug==2.0.1 62 | wrapt==1.12.1 63 | zipp==3.5.0 64 | -------------------------------------------------------------------------------- /plugins/miscellaneous/TargetWidget.py: -------------------------------------------------------------------------------- 1 | from PyQt5.QtWidgets import QAbstractItemView, QMenu, QAction, QListView, QSizePolicy 2 | from PyQt5.QtCore import Qt, QEvent, QSize 3 | from PyQt5.QtGui import QStandardItemModel 4 | 5 | from .Widget import Widget 6 | 7 | class TargetWidget(Widget): 8 | def __init__(self,parent=None): 9 | super(TargetWidget, self).__init__(parent) 10 | 11 | self.setDragEnabled(True) 12 | self.setAcceptDrops(True) 13 | self.setDropIndicatorShown(True) 14 | self.setDragDropMode(QAbstractItemView.DragDrop) 15 | self.setContextMenuPolicy(Qt.CustomContextMenu) 16 | self.customContextMenuRequested.connect(self.contextMenu) 17 | self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) 18 | 19 | def sizeHint(self): 20 | s = QSize() 21 | s.setHeight(200) 22 | s.setWidth(150) 23 | return s 24 | 25 | def contextMenu(self, point): 26 | menu = QMenu(self) 27 | menu.setStyleSheet("background-color:white;") 28 | menu.setStyleSheet("color:black;") 29 | 30 | action = QAction('Delete', self) 31 | action.triggered.connect(self.onDeleteItem) 32 | menu.addAction(action) 33 | 34 | menu.exec_(self.mapToGlobal(point)) 35 | 36 | def onDeleteItem(self): 37 | self.model().removeRow(self.selected.row()) 38 | 39 | if self.onDeleteCallback is not None: 40 | self.onDeleteCallback() 41 | 42 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/es6-shim/LICENSE: -------------------------------------------------------------------------------- 1 | The project was initially based on [es6-shim by Axel Rauschmayer](https://github.com/rauschma/es6-shim). 2 | 3 | Current maintainers are: [Paul Miller](http://paulmillr.com), [Jordan Harband](https://github.com/ljharb), and [C. Scott Ananian](http://cscott.net). 4 | 5 | The MIT License (MIT) 6 | 7 | Copyright (c) 2013-2016 Paul Miller (http://paulmillr.com) and contributors 8 | 9 | Permission is hereby granted, free of charge, to any person obtaining a copy 10 | of this software and associated documentation files (the "Software"), to deal 11 | in the Software without restriction, including without limitation the rights 12 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | copies of the Software, and to permit persons to whom the Software is 14 | furnished to do so, subject to the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be included in 17 | all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | 27 | -------------------------------------------------------------------------------- /specs/build_coordinates_.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python -*- 2 | import sys 3 | from os import path, pardir 4 | main_dir = os.path.abspath(SPECPATH) 5 | main_dir = os.path.dirname(main_dir) 6 | block_cipher = None 7 | 8 | pathex=[] 9 | for dirpath, dirnames, filenames in os.walk( path.join(main_dir, "segment","_3D_FFN","ffn") ): 10 | if os.path.basename(dirpath) != '__pycache__': 11 | pathex.append(path.join(main_dir, "segment", dirpath)) 12 | 13 | translate=[path.join(main_dir, "segment","_3D_FFN","ffn","build_coordinates.py")] 14 | print(translate) 15 | 16 | a = Analysis(translate, 17 | pathex=pathex, 18 | binaries=[], 19 | datas=[], 20 | hiddenimports=['scipy._lib.messagestream','pywt._extensions._cwt','tensorflow.contrib'], 21 | hookspath=[], 22 | runtime_hooks=[], 23 | excludes=[], 24 | win_no_prefer_redirects=False, 25 | win_private_assemblies=False, 26 | cipher=block_cipher) 27 | pyz = PYZ(a.pure, a.zipped_data, 28 | cipher=block_cipher) 29 | exe = EXE(pyz, 30 | a.scripts, 31 | exclude_binaries=True, 32 | name='build_coordinates', 33 | debug=False, 34 | strip=False, 35 | upx=True, 36 | console=True ) 37 | coll = COLLECT(exe, 38 | a.binaries, 39 | a.zipfiles, 40 | a.datas, 41 | strip=False, 42 | upx=True, 43 | name='build_coordinates') 44 | -------------------------------------------------------------------------------- /specs/compute_partitions_.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python -*- 2 | import sys 3 | from os import path, pardir 4 | main_dir = os.path.abspath(SPECPATH) 5 | main_dir = os.path.dirname(main_dir) 6 | block_cipher = None 7 | 8 | pathex=[] 9 | for dirpath, dirnames, filenames in os.walk( path.join(main_dir, "segment","_3D_FFN","ffn") ): 10 | if os.path.basename(dirpath) != '__pycache__': 11 | pathex.append(path.join(main_dir, "segment", dirpath)) 12 | 13 | translate=[path.join(main_dir, "segment","_3D_FFN","ffn","compute_partitions.py")] 14 | print(translate) 15 | 16 | a = Analysis(translate, 17 | pathex=pathex, 18 | binaries=[], 19 | datas=[], 20 | hiddenimports=['scipy._lib.messagestream','pywt._extensions._cwt','tensorflow.contrib'], 21 | hookspath=[], 22 | runtime_hooks=[], 23 | excludes=[], 24 | win_no_prefer_redirects=False, 25 | win_private_assemblies=False, 26 | cipher=block_cipher) 27 | pyz = PYZ(a.pure, a.zipped_data, 28 | cipher=block_cipher) 29 | exe = EXE(pyz, 30 | a.scripts, 31 | exclude_binaries=True, 32 | name='compute_partitions', 33 | debug=False, 34 | strip=False, 35 | upx=True, 36 | console=True ) 37 | coll = COLLECT(exe, 38 | a.binaries, 39 | a.zipfiles, 40 | a.datas, 41 | strip=False, 42 | upx=True, 43 | name='compute_partitions') 44 | -------------------------------------------------------------------------------- /requirements-win.txt: -------------------------------------------------------------------------------- 1 | numpy==1.19.5 2 | absl-py==0.13.0 3 | altgraph==0.17 4 | astor==0.8.1 5 | astunparse==1.6.3 6 | cachetools==4.2.2 7 | certifi==2021.5.30 8 | charset-normalizer==2.0.4 9 | cycler==0.10.0 10 | flatbuffers==1.12 11 | future==0.18.2 12 | gast==0.3.3 13 | google-auth==1.35.0 14 | google-auth-oauthlib==0.4.6 15 | google-pasta==0.2.0 16 | grpcio==1.32.0 17 | h5py==2.10.0 18 | idna==3.2 19 | imageio==2.9.0 20 | Keras-Applications==1.0.8 21 | Keras-Preprocessing==1.1.2 22 | kiwisolver==1.3.2 23 | lxml==4.6.3 24 | mahotas==1.4.11 25 | Markdown==3.3.4 26 | matplotlib==3.4.3 27 | networkx==2.6.2 28 | numpy-stl==2.16.2 29 | oauthlib==3.1.1 30 | opencv-python==4.5.3.56 31 | opt-einsum==3.3.0 32 | pefile==2021.9.3 33 | Pillow==8.3.2 34 | protobuf==3.17.3 35 | pyasn1==0.4.8 36 | pyasn1-modules==0.2.8 37 | pyinstaller==4.5.1 38 | pyinstaller-hooks-contrib==2021.3 39 | pyparsing==2.4.7 40 | pypng==0.0.21 41 | PyQt5==5.15.4 42 | PyQt5-Qt5==5.15.2 43 | PyQt5-sip==12.9.0 44 | PyQtWebEngine==5.15.4 45 | PyQtWebEngine-Qt5==5.15.2 46 | python-dateutil==2.8.2 47 | python-utils==2.5.6 48 | PyWavelets==1.1.1 49 | pywin32-ctypes==0.2.0 50 | requests==2.26.0 51 | requests-oauthlib==1.3.0 52 | rsa==4.7.2 53 | scikit-image==0.18.3 54 | scipy==1.7.1 55 | six==1.15.0 56 | tensorboard==2.6.0 57 | tensorboard-data-server==0.6.1 58 | tensorboard-plugin-wit==1.8.0 59 | tensorflow==2.4.1 60 | tensorflow-estimator==2.4.0 61 | termcolor==1.1.0 62 | tifffile==2021.8.30 63 | tornado==6.1 64 | typing-extensions==3.7.4.3 65 | urllib3==1.26.6 66 | Werkzeug==2.0.1 67 | wrapt==1.12.1 68 | -------------------------------------------------------------------------------- /specs/train_.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python -*- 2 | import sys 3 | from os import path, pardir 4 | main_dir = os.path.abspath(SPECPATH) 5 | main_dir = os.path.dirname(main_dir) 6 | block_cipher = None 7 | 8 | pathex=[] 9 | for dirpath, dirnames, filenames in os.walk( path.join(main_dir, "segment","_3D_FFN","ffn") ): 10 | if os.path.basename(dirpath) != '__pycache__': 11 | pathex.append(path.join(main_dir, "segment", dirpath)) 12 | 13 | translate=[path.join(main_dir, "segment","_3D_FFN","ffn","train.py")] 14 | print(translate) 15 | 16 | a = Analysis(translate, 17 | pathex=pathex, 18 | binaries=[], 19 | datas=[], 20 | hiddenimports=['scipy._lib.messagestream','pywt._extensions._cwt','gast','astor','termcolor','google.protobuf.wrappers_pb2','tensorflow.contrib'], 21 | hookspath=[], 22 | runtime_hooks=[], 23 | excludes=[], 24 | win_no_prefer_redirects=False, 25 | win_private_assemblies=False, 26 | cipher=block_cipher) 27 | pyz = PYZ(a.pure, a.zipped_data, 28 | cipher=block_cipher) 29 | exe = EXE(pyz, 30 | a.scripts, 31 | exclude_binaries=True, 32 | name='train', 33 | debug=False, 34 | strip=False, 35 | upx=True, 36 | console=True ) 37 | coll = COLLECT(exe, 38 | a.binaries, 39 | a.zipfiles, 40 | a.datas, 41 | strip=False, 42 | upx=True, 43 | name='train') 44 | -------------------------------------------------------------------------------- /system/Script.py: -------------------------------------------------------------------------------- 1 | 2 | import importlib.util 3 | from importlib import machinery 4 | import sys 5 | import os 6 | from os import path, pardir 7 | from PyQt5.QtWidgets import QFileDialog 8 | from PyQt5.QtCore import Qt 9 | from PyQt5.QtGui import QIcon, QPixmap 10 | 11 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 12 | icon_dir = path.join(main_dir, "icons") 13 | icon_disabled_dir = path.join(icon_dir, "Disabled") 14 | sys.path.append(path.join(main_dir, "plugins")) 15 | sys.path.append(path.join(main_dir, "system")) 16 | sys.path.append(path.join(main_dir, "dojoio")) 17 | import importlib.util 18 | 19 | 20 | class Script(): 21 | def Script(self): 22 | filename = QFileDialog.getOpenFileName(self, 'Open file', main_dir, filter='*.py') 23 | if len(filename[0]) == 0: 24 | return 25 | print('Execute file: ') 26 | print(filename[0]) 27 | 28 | # spec = importlib.util.spec_from_file_location(os.path.basename(filename[0]), os.path.dirname(filename[0])) 29 | # foo = importlib.util.module_from_spec(spec) 30 | # spec.loader.exec_module(foo) 31 | 32 | #foo = importlib.import_module(filename[0]) 33 | #foo.MyClass(self) 34 | 35 | # loader = machinery.SourceFileLoader('MyClass', filename[0]) 36 | # module = loader.load_module() 37 | # module.MyClass(self) 38 | # module = None 39 | # print(module) 40 | 41 | try: 42 | exec(open(filename[0]).read()) 43 | except SyntaxError as err: 44 | print('Syntax error. Line ', err.lineno) 45 | -------------------------------------------------------------------------------- /specs/run_inference_win_.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python -*- 2 | import sys 3 | from os import path, pardir 4 | main_dir = os.path.abspath(SPECPATH) 5 | main_dir = os.path.dirname(main_dir) 6 | block_cipher = None 7 | 8 | pathex=[] 9 | for dirpath, dirnames, filenames in os.walk( path.join(main_dir, "segment","_3D_FFN","ffn") ): 10 | if os.path.basename(dirpath) != '__pycache__': 11 | pathex.append(path.join(main_dir, "segment", dirpath)) 12 | 13 | translate=[path.join(main_dir, "segment","_3D_FFN","ffn","run_inference_win.py")] 14 | print(translate) 15 | 16 | a = Analysis(translate, 17 | pathex=pathex, 18 | binaries=[], 19 | datas=[], 20 | hiddenimports=['scipy._lib.messagestream','pywt._extensions._cwt','PyQt5.sip','gast','astor','termcolor','google.protobuf.wrappers_pb2','tensorflow.contrib'], 21 | hookspath=[], 22 | runtime_hooks=[], 23 | excludes=[], 24 | win_no_prefer_redirects=False, 25 | win_private_assemblies=False, 26 | cipher=block_cipher) 27 | pyz = PYZ(a.pure, a.zipped_data, 28 | cipher=block_cipher) 29 | exe = EXE(pyz, 30 | a.scripts, 31 | exclude_binaries=True, 32 | name='run_inference_win', 33 | debug=False, 34 | strip=False, 35 | upx=True, 36 | console=True ) 37 | coll = COLLECT(exe, 38 | a.binaries, 39 | a.zipfiles, 40 | a.datas, 41 | strip=False, 42 | upx=True, 43 | name='run_inference_win') 44 | -------------------------------------------------------------------------------- /_web_dojo/gfx/loading-three-dots.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 12 | 13 | 14 | 18 | 22 | 23 | 24 | 28 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /segment/_2D_DNN/InferenceTab.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os, time, errno 5 | from os import path, pardir 6 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 7 | sys.path.append(main_dir) 8 | sys.path.append(path.join(main_dir, "segment")) 9 | sys.path.append(path.join(main_dir, "system")) 10 | from _2D_DNN.InferenceExe import InferenceExe 11 | 12 | class InferenceTab(InferenceExe): 13 | 14 | def __init__(self, u_info): 15 | 16 | self.paramfile = os.path.join( u_info.parameters_path, "Inference_2D.pickle") 17 | 18 | self.title = '2D Inference' 19 | 20 | self.tips = [ 21 | 'Path to folder containing images for inference', 22 | 'Tensorflow model folder', 23 | 'Path to folder to store inferred segmentation', 24 | 'Output Filetype', 25 | 'Unit size of images for inference. Large image will be splited into pieces of the unit-size images.' 26 | ] 27 | 28 | 29 | self.args = [ 30 | ['Image Folder', 'SelectImageFolder', 'OpenImageFolder'], 31 | ['Model Folder', 'SelectModelFolder', 'OpenModelFolder'], 32 | ['Output Segmentation Folder (Empty)', 'SelectEmptyFolder', 'OpenEmptyFolder'], 33 | ['Output Filetype', 'ComboBox', ['8-bit gray scale PNG', '8-bit gray scale TIFF (Uncompressed)', '8-bit gray scale TIFF (Compressed)']], 34 | ['Maximal unit image size', 'ComboBox', ["512", "1024", "2048"]] 35 | ] 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/underscore/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "underscore", 3 | "description": "JavaScript's functional programming helper library.", 4 | "homepage": "http://underscorejs.org", 5 | "keywords": [ 6 | "util", 7 | "functional", 8 | "server", 9 | "client", 10 | "browser" 11 | ], 12 | "author": "Jeremy Ashkenas ", 13 | "repository": { 14 | "type": "git", 15 | "url": "git://github.com/jashkenas/underscore.git" 16 | }, 17 | "main": "underscore.js", 18 | "version": "1.9.1", 19 | "devDependencies": { 20 | "coveralls": "^2.11.2", 21 | "docco": "*", 22 | "eslint": "1.10.x", 23 | "gzip-size-cli": "^1.0.0", 24 | "karma": "^0.13.13", 25 | "karma-qunit": "~2.0.1", 26 | "nyc": "^2.1.3", 27 | "pretty-bytes-cli": "^1.0.0", 28 | "qunit-cli": "~0.2.0", 29 | "qunit": "^2.6.0", 30 | "uglify-js": "3.3.21" 31 | }, 32 | "scripts": { 33 | "test": "npm run lint && npm run test-node", 34 | "coverage": "nyc npm run test-node && nyc report", 35 | "coveralls": "nyc npm run test-node && nyc report --reporter=text-lcov | coveralls", 36 | "lint": "eslint underscore.js test/*.js", 37 | "test-node": "qunit-cli test/*.js", 38 | "test-browser": "npm i karma-phantomjs-launcher && karma start", 39 | "minify": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m", 40 | "build": "npm run minify -- --source-map --source-map-url \" \" -o underscore-min.js", 41 | "doc": "docco underscore.js", 42 | "weight": "npm run minify | gzip-size | pretty-bytes" 43 | }, 44 | "license": "MIT", 45 | "files": [ 46 | "underscore.js", 47 | "underscore-min.js", 48 | "underscore-min.js.map" 49 | ] 50 | } 51 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /_web_dojo/css/dragresize.css: -------------------------------------------------------------------------------- 1 | /* Required CSS classes: must be included in all pages using this script */ 2 | 3 | /* Apply the element you want to drag/resize */ 4 | .drsElement { 5 | position: absolute; 6 | border: 1px solid #333; 7 | } 8 | 9 | /* 10 | The main mouse handle that moves the whole element. 11 | You can apply to the same tag as drsElement if you want. 12 | */ 13 | .drsMoveHandle { 14 | /*height: 10px;*/ 15 | background-color: #000; 16 | border-bottom: 1px solid #666; 17 | cursor: move; 18 | color: white; 19 | } 20 | 21 | /* 22 | The DragResize object name is automatically applied to all generated 23 | corner resize handles, as well as one of the individual classes below. 24 | */ 25 | .dragresize { 26 | position: absolute; 27 | width: 5px; 28 | height: 5px; 29 | font-size: 1px; 30 | background: #EEE; 31 | border: 1px solid #333; 32 | } 33 | 34 | /* 35 | Individual corner classes - required for resize support. 36 | These are based on the object name plus the handle ID. 37 | */ 38 | .dragresize-tl { 39 | top: -8px; 40 | left: -8px; 41 | cursor: nw-resize; 42 | } 43 | .dragresize-tm { 44 | top: -8px; 45 | left: 50%; 46 | margin-left: -4px; 47 | cursor: n-resize; 48 | } 49 | .dragresize-tr { 50 | top: -8px; 51 | right: -8px; 52 | cursor: ne-resize; 53 | } 54 | 55 | .dragresize-ml { 56 | top: 50%; 57 | margin-top: -4px; 58 | left: -8px; 59 | cursor: w-resize; 60 | } 61 | .dragresize-mr { 62 | top: 50%; 63 | margin-top: -4px; 64 | right: -8px; 65 | cursor: e-resize; 66 | } 67 | 68 | .dragresize-bl { 69 | bottom: -8px; 70 | left: -8px; 71 | cursor: sw-resize; 72 | } 73 | .dragresize-bm { 74 | bottom: -8px; 75 | left: 50%; 76 | margin-left: -4px; 77 | cursor: s-resize; 78 | } 79 | .dragresize-br { 80 | bottom: -8px; 81 | right: -8px; 82 | cursor: se-resize; 83 | } 84 | 85 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/es6-shim/es6-sham.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * https://github.com/paulmillr/es6-shim 3 | * @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com) 4 | * and contributors, MIT License 5 | * es6-sham: v0.35.1 6 | * see https://github.com/paulmillr/es6-shim/blob/0.35.1/LICENSE 7 | * Details and documentation: 8 | * https://github.com/paulmillr/es6-shim/ 9 | */ 10 | (function(t,e){if(typeof define==="function"&&define.amd){define(e)}else if(typeof exports==="object"){module.exports=e()}else{t.returnExports=e()}})(this,function(){"use strict";var t=new Function("return this;");var e=t();var r=e.Object;var n=Function.call.bind(Function.call);var o=Function.toString;var i=String.prototype.match;var f=function(t){try{t();return false}catch(t){return true}};var a=function(){return!f(function(){r.defineProperty({},"x",{get:function(){}})})};var u=!!r.defineProperty&&a();(function(){if(r.setPrototypeOf){return}var t=r.getOwnPropertyNames;var e=r.getOwnPropertyDescriptor;var n=r.create;var o=r.defineProperty;var i=r.getPrototypeOf;var f=r.prototype;var a=function(r,n){t(n).forEach(function(t){o(r,t,e(n,t))});return r};var u=function(t,e){return a(n(e),t)};var c,s;try{c=e(f,"__proto__").set;c.call({},null);s=function(t,e){c.call(t,e);return t}}catch(t){c={__proto__:null};if(c instanceof r){s=u}else{c.__proto__=f;if(c instanceof r){s=function(t,e){t.__proto__=e;return t}}else{s=function(t,e){if(i(t)){t.__proto__=e;return t}else{return u(t,e)}}}}}r.setPrototypeOf=s})();if(u&&function foo(){}.name!=="foo"){r.defineProperty(Function.prototype,"name",{configurable:true,enumerable:false,get:function(){var t=n(o,this);var e=n(i,t,/\s*function\s+([^(\s]*)\s*/);var f=e&&e[1];r.defineProperty(this,"name",{configurable:true,enumerable:false,writable:false,value:f});return f}})}}); 11 | //# sourceMappingURL=es6-sham.map 12 | -------------------------------------------------------------------------------- /_web_annotator/js/GridHelper.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @author mrdoob / http://mrdoob.com/ 3 | */ 4 | 5 | import { LineSegments } from '../objects/LineSegments.js'; 6 | import { VertexColors } from '../constants.js'; 7 | import { LineBasicMaterial } from '../materials/LineBasicMaterial.js'; 8 | import { Float32BufferAttribute } from '../core/BufferAttribute.js'; 9 | import { BufferGeometry } from '../core/BufferGeometry.js'; 10 | import { Color } from '../math/Color.js'; 11 | 12 | function GridHelper( size, divisions, color1, color2 ) { 13 | 14 | size = size || 10; 15 | divisions = divisions || 10; 16 | color1 = new Color( color1 !== undefined ? color1 : 0x444444 ); 17 | color2 = new Color( color2 !== undefined ? color2 : 0x888888 ); 18 | 19 | var center = divisions / 2; 20 | var step = size / divisions; 21 | var halfSize = size / 2; 22 | 23 | var vertices = [], colors = []; 24 | 25 | for ( var i = 0, j = 0, k = - halfSize; i <= divisions; i ++, k += step ) { 26 | 27 | vertices.push( - halfSize, 0, k, halfSize, 0, k ); 28 | vertices.push( k, 0, - halfSize, k, 0, halfSize ); 29 | 30 | var color = i === center ? color1 : color2; 31 | 32 | color.toArray( colors, j ); j += 3; 33 | color.toArray( colors, j ); j += 3; 34 | color.toArray( colors, j ); j += 3; 35 | color.toArray( colors, j ); j += 3; 36 | 37 | } 38 | 39 | var geometry = new BufferGeometry(); 40 | geometry.addAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); 41 | geometry.addAttribute( 'color', new Float32BufferAttribute( colors, 3 ) ); 42 | 43 | var material = new LineBasicMaterial( { vertexColors: VertexColors } ); 44 | 45 | LineSegments.call( this, geometry, material ); 46 | 47 | } 48 | 49 | GridHelper.prototype = Object.create( LineSegments.prototype ); 50 | GridHelper.prototype.constructor = GridHelper; 51 | 52 | export { GridHelper }; 53 | -------------------------------------------------------------------------------- /plugins/Filter2D3D/FiltersInfo.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | 5 | from Filter2D3D.filters import Binary 6 | from Filter2D3D.filters import Canny 7 | from Filter2D3D.filters import Gaussian 8 | from Filter2D3D.filters import Invert 9 | from Filter2D3D.filters import Label 10 | from Filter2D3D.filters import Skimg 11 | from Filter2D3D.filters import Label3D 12 | from Filter2D3D.filters import Skimg3D 13 | from Filter2D3D.filters import CLAHE 14 | 15 | class FilterInfo(object): 16 | def __init__(self): 17 | self.__info = [ 18 | {'type': '2d', 'name': 'Binary', 'class': Binary.Binary}, 19 | {'type': '2d', 'name': 'Canny', 'class': Canny.Canny}, 20 | {'type': '2d', 'name': 'Gaussian', 'class': Gaussian.Gaussian}, 21 | {'type': '2d', 'name': 'Invert', 'class': Invert.Invert}, 22 | {'type': '2d', 'name': '2D Label', 'class': Label.Label}, 23 | {'type': '2d', 'name': '2D Watershed', 'class': Skimg.Skimg}, 24 | {'type': '2d', 'name': 'CLAHE', 'class': CLAHE.CLAHE}, 25 | {'type': '3d', 'name': '3D Label', 'class': Label3D.Label3D}, 26 | {'type': '3d', 'name': '3D Watershed', 'class': Skimg3D.Skimg3D}, 27 | ] 28 | 29 | def get_2d_filter_name_list(self): 30 | for i in self.__info: 31 | if i['type'] == '2d': 32 | yield i['name'] 33 | 34 | def get_3d_filter_name_list(self): 35 | for i in self.__info: 36 | if i['type'] == '3d': 37 | yield i['name'] 38 | 39 | def get_class(self, name): 40 | for i in self.__info: 41 | if name == i['name']: 42 | return i['class'] 43 | 44 | def get_type(self, name): 45 | for i in self.__info: 46 | if name == i['name']: 47 | return i['type'] 48 | 49 | -------------------------------------------------------------------------------- /dojo/setup.py: -------------------------------------------------------------------------------- 1 | 2 | import os 3 | import re 4 | 5 | class Setup(object): 6 | 7 | def __init__(self,logic,mojo_dir, tmp_dir): 8 | ''' 9 | ''' 10 | 11 | self.__logic = logic 12 | 13 | self.__mojo_dir = mojo_dir 14 | self.__tmp_dir = tmp_dir 15 | 16 | self.__query_viewer_regex = re.compile('^/dojo/.*$') 17 | self.__post_data_regex = re.compile('^/setup/data$') 18 | 19 | self.__web_dir = '_web/' 20 | 21 | def content_type(self, extension): 22 | ''' 23 | ''' 24 | return { 25 | '.js': 'text/javascript', 26 | '.html': 'text/html', 27 | '.png': 'image/png', 28 | '.jpg': 'image/jpeg', 29 | '.gif': 'image/gif', 30 | '.map': 'text/html', 31 | '.css': 'text/css', 32 | '.stl': 'image/stl', 33 | '.cur': 'image/x-win-bitmap' 34 | }[extension] 35 | 36 | def handle(self, request): 37 | ''' 38 | ''' 39 | # if self.__post_data_regex.match(request.uri): 40 | # self.setup_data(request) 41 | # return "OK", 'text/html' 42 | 43 | if not self.__query_viewer_regex.match(request.uri): 44 | # this is not a valid request for the viewer 45 | return None, None 46 | 47 | url = request.uri 48 | 49 | # remove query 50 | url = url.split('?')[0] 51 | 52 | # check if a request goes straight to a folder 53 | # if url.split('/')[-1] == '': 54 | # add index.html 55 | # url += 'setup.html' 56 | 57 | # get filename from query 58 | requested_file = self.__web_dir + url.replace('/dojo/', '') 59 | extension = os.path.splitext(requested_file)[1] 60 | 61 | 62 | 63 | if not os.path.exists(requested_file): 64 | return 'Error 404', 'text/html' 65 | 66 | with open(requested_file, 'r') as f: 67 | content = f.read() 68 | 69 | return content, self.content_type(extension) 70 | 71 | 72 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/ffn/utils/object_utils.py: -------------------------------------------------------------------------------- 1 | # Copyright 2018 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | 16 | """Utilities for object processing.""" 17 | 18 | from __future__ import absolute_import 19 | from __future__ import division 20 | from __future__ import print_function 21 | 22 | import networkx as nx 23 | import pandas as pd 24 | import logging 25 | 26 | 27 | def load_equivalences(paths): 28 | """Loads equivalences from a text file. 29 | 30 | Args: 31 | paths: sequence of paths to the text files of equivalences; id0,id1 per 32 | line, or id0,id1,x,y,z. 33 | 34 | Returns: 35 | NX graph object representing the equivalences 36 | """ 37 | equiv_graph = nx.Graph() 38 | 39 | for path in paths: 40 | with open(path, "r") as f: 41 | reader = pd.read_csv( 42 | f, sep=",", engine="c", comment="#", chunksize=4096, header=None) 43 | for chunk in reader: 44 | if len(chunk.columns) not in (2, 5): 45 | logging.critical("Unexpected # of columns (%d), want 2 or 5", 46 | len(chunk.columns)) 47 | 48 | edges = chunk.values[:, :2] 49 | equiv_graph.add_edges_from(edges) 50 | 51 | return equiv_graph 52 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/ffn/inference/inference_flags.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | """Helpers to initialize protos from flag values.""" 16 | 17 | from __future__ import absolute_import 18 | from __future__ import division 19 | from __future__ import print_function 20 | 21 | from google.protobuf import text_format 22 | from absl import flags 23 | from . import inference_pb2 24 | 25 | 26 | FLAGS = flags.FLAGS 27 | 28 | flags.DEFINE_string('inference_request', None, 29 | 'InferenceRequest proto in text format.') 30 | flags.DEFINE_string('inference_options', None, 31 | 'InferenceOptions proto in text format.') 32 | 33 | 34 | def options_from_flags(): 35 | options = inference_pb2.InferenceOptions() 36 | if FLAGS.inference_options: 37 | text_format.Parse(FLAGS.inference_options, options) 38 | 39 | return options 40 | 41 | 42 | def request_from_flags(): 43 | request = inference_pb2.InferenceRequest() 44 | print(FLAGS.inference_request) 45 | if FLAGS.inference_request: 46 | with open(FLAGS.inference_request, mode='r') as f: 47 | text_list = f.readlines() 48 | text = ' '.join(text_list) 49 | print(text) 50 | text_format.Parse(text, request) 51 | 52 | return request 53 | -------------------------------------------------------------------------------- /system/Credit.py: -------------------------------------------------------------------------------- 1 | 2 | import sys 3 | import os 4 | from os import path 5 | from PyQt5.QtWidgets import QMessageBox 6 | from PyQt5.QtGui import QIcon, QPixmap 7 | from PyQt5.QtCore import pyqtSlot 8 | 9 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 10 | icon_dir = path.join(main_dir, "icons") 11 | icon_disabled_dir = path.join(icon_dir, "Disabled") 12 | 13 | 14 | class Credit(): 15 | def Credit(self): 16 | #QMessageBox.setIcon(QMessageBox.Information) 17 | msg = QMessageBox(QMessageBox.Information, "About UNI-EM", 18 | "

UNI-EM Ver0.92.1


" 19 | "(C) 2019 Hidetoshi Urakubo, Torsten Bullmann, Ryoji Miyamoto, Naoki Tamura, Ryoya Kamikawa.
" 20 | "This project is licensed under the GNU General Public License Version 3 (GPLv3).
" 21 | "UNI-EM is powered by the following software:
" 22 | "Flood filling networks
" 23 | "Imagetranslation-tensorflow
" 24 | "Tensorflow,
" 25 | "Qt,
" 26 | "Three.js,
" 27 | "Rhoana Dojo
" 28 | "Open CV
" 29 | "Scikit-image
" 30 | ) 31 | msg.setIconPixmap(QPixmap(path.join(icon_dir, "Mojo2_128.png"))) 32 | exe = msg.exec_() 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /dojo/viewer.py: -------------------------------------------------------------------------------- 1 | 2 | import os 3 | import re 4 | import sys 5 | 6 | from os import path, pardir 7 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 8 | 9 | 10 | class Viewer(object): 11 | 12 | def __init__(self, u_info): 13 | ''' 14 | ''' 15 | self.__query_viewer_regex = re.compile('^/dojo/.*$') 16 | self.__web_dir = u_info.web_path 17 | 18 | 19 | def content_type(self, extension): 20 | ''' 21 | ''' 22 | return { 23 | '.js': 'text/javascript', 24 | '.html': 'text/html', 25 | '.png': 'image/png', 26 | '.map': 'text/html', 27 | '.css': 'text/css', 28 | '.cur': 'image/x-win-bitmap', 29 | '.stl': 'image/stl' 30 | }[extension] 31 | 32 | def handle(self, request): 33 | ''' 34 | ''' 35 | 36 | if not self.__query_viewer_regex.match(request.uri): 37 | # this is not a valid request for the viewer 38 | return None, None 39 | 40 | url = request.uri 41 | 42 | # remove query 43 | url = url.split('?')[0] 44 | 45 | # check if a request goes straight to a folder 46 | if url.split('/')[-1] == '': 47 | # add index.html 48 | url += 'index.html' 49 | 50 | # get filename from query 51 | requested_file = self.__web_dir + os.sep + url.replace('/dojo/', '') 52 | requested_file = os.path.normpath( requested_file ) 53 | extension = os.path.splitext(requested_file)[1] 54 | 55 | 56 | # print('requested_file: ', requested_file) 57 | # print('extension: ', extension) 58 | 59 | if not os.path.exists(requested_file): 60 | return 'Error 404', 'text/html' 61 | 62 | 63 | #if sys.version_info.major == 2: 64 | # with open(requested_file, 'r') as f: 65 | # content = f.read() 66 | # else : 67 | 68 | with open(requested_file, 'r', encoding="utf-8_sig") as f: 69 | content = f.read() 70 | 71 | return content, self.content_type(extension) 72 | 73 | 74 | -------------------------------------------------------------------------------- /plugins/Template/Inference.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## 3 | ## 4 | import sys, os 5 | import subprocess as s 6 | import miscellaneous.Miscellaneous as m 7 | 8 | from os import path, pardir 9 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 10 | # exec_template = ['python', os.path.join(main_dir, 'plugins', 'Template', 'run_example.py')] 11 | 12 | class Inference(): 13 | 14 | def _Run(self, parent, params, comm_title): 15 | ## 16 | tmp = [ '--test_image_folder' , params['Test image folder'] , \ 17 | '--inferred_segmentation_folder' , params['Inferred segmentation folder'] , \ 18 | '--tensorflow_model_file' , params['Model Folder'] ] 19 | 20 | comm_run = self.u_info.exec_template[:] 21 | comm_run.extend( tmp ) 22 | print('') 23 | print(' '.join(comm_run)) 24 | print('') 25 | ## 26 | m.UnlockFolder(self.u_info, params['Inferred segmentation folder']) # Only for shared folder/file 27 | s.run(comm_run) 28 | m.LockFolder(self.u_info, params['Inferred segmentation folder']) 29 | print(comm_title, 'was finished.\n') 30 | ## 31 | return True 32 | 33 | def __init__(self, u_info): 34 | ## 35 | self.u_info = u_info 36 | self.paramfile = os.path.join(u_info.parameters_path, "Inference.pickle") 37 | 38 | self.title = 'Inference' 39 | 40 | self.tips = [ 41 | 'Input: Path to folder containing target images', 42 | 'Output: Path to folder storing inferred images', 43 | 'Input: Tensorflow model Folder' 44 | ] 45 | 46 | self.args = [ 47 | ['Test image folder', 'SelectImageFolder', 'OpenImageFolder'], 48 | ['Inferred segmentation folder', 'SelectImageFolder', 'OpenImageFolder'], 49 | ['Model Folder', 'SelectModelFolder', 'OpenModelFolder'] 50 | ] 51 | 52 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/ffn/utils/bounding_box.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ============================================================================== 15 | // Defines messages representing regions of volumetric datasets. 16 | 17 | syntax = "proto2"; 18 | 19 | package ffn; 20 | 21 | import "utils/vector.proto"; 22 | 23 | // Describes a 3-dimensional axis-aligned hyperrectangular region of voxels. 24 | // The region contains whole numbers of rows, columns and layers of voxels 25 | // (i.e., not fractional ones). 26 | message BoundingBox { 27 | // The minimum X, Y and Z coordinates of any voxel in the region. 28 | optional proto.Vector3j start = 1; // required 29 | 30 | // The size of the region in the X, Y and Z dimensions, in units of voxels. 31 | // The maximum X, Y and Z coordinates of any voxel in the region are 32 | // start + size - 1. 33 | // 34 | // INVARIANT: size.x, y and z are all >0. 35 | optional proto.Vector3j size = 2; // required 36 | 37 | // An optional string associated with this bounding box. 38 | optional string description = 3; 39 | 40 | // An optional object label associated with this bounding box. This is uint64 41 | // to match usage of uint64 for segmentations represented by NDArrays. 42 | optional uint64 object_label = 4; 43 | }; 44 | 45 | // A sequence of bounding boxes. 46 | message BoundingBoxes { 47 | repeated BoundingBox box = 1; 48 | }; 49 | -------------------------------------------------------------------------------- /plugins/miscellaneous/Widget.py: -------------------------------------------------------------------------------- 1 | from PyQt5.QtWidgets import QListWidget, QListWidgetItem 2 | from PyQt5.QtCore import Qt 3 | 4 | class Widget(QListWidget): 5 | def __init__(self, parent=None): 6 | super(Widget,self).__init__(parent) 7 | 8 | self.width = 150 9 | 10 | self.dragging = False 11 | self.layout = None 12 | self.onClickedCallback = None 13 | self.onInsertedCallback = None 14 | self.onDeleteCallback = None 15 | self.onDropCallback = None 16 | 17 | self.itemClicked.connect(self.onClicked) 18 | self.model().rowsInserted.connect(self.onInserted) 19 | self.setStyleSheet("color:black;") 20 | self.setMinimumWidth(self.width) 21 | 22 | self.widgets = [] 23 | self.title_label = None 24 | 25 | def remove(self): 26 | for w in self.widgets: 27 | w.deleteLater() 28 | self.widgets = [] 29 | 30 | def addWidget(self, w): 31 | self.layout.addWidget(w) 32 | self.widgets.append(w) 33 | 34 | def onInserted(self, parent, start, end): 35 | if self.onInsertedCallback is not None: 36 | self.onInsertedCallback(parent, start, end) 37 | 38 | def onClicked(self, item): 39 | if self.onClickedCallback is not None: 40 | self.onClickedCallback(self.selected) 41 | 42 | @property 43 | def selected(self): 44 | selModel = self.selectionModel() 45 | indexes = selModel.selectedIndexes() 46 | selected = None 47 | if len(indexes) != 0: 48 | selected = indexes[0] 49 | 50 | return selected 51 | 52 | def dragEnterEvent(self, e): 53 | self.dragging = True 54 | 55 | super(Widget, self).dragEnterEvent(e) 56 | 57 | def dropEvent(self, e): 58 | if self.onDropCallback is not None: 59 | self.onDropCallback() 60 | 61 | self.dragging = False 62 | 63 | super(Widget, self).dropEvent(e) 64 | 65 | def dragLeaveEvent(self, e): 66 | super(Widget, self).dragLeaveEvent(e) 67 | 68 | -------------------------------------------------------------------------------- /annotator/Annotator/Annotator.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | from PyQt5.QtWidgets import QMessageBox, QWidget, QFileDialog 4 | from PyQt5.QtGui import QIcon, QPixmap 5 | from PyQt5.QtCore import Qt, pyqtSlot 6 | 7 | import socket 8 | import sys 9 | import os 10 | from os import path, pardir 11 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 12 | icon_dir = path.join(main_dir, "icons") 13 | sys.path.append(path.join(main_dir, "annotator")) 14 | from annotator.Annotator.AnnotatorServer import AnnotatorServerLogic 15 | from annotator.Annotator.ControlAnnotatorServer import ControlAnnotatorServer 16 | 17 | 18 | # import wxglade_superpixel 19 | 20 | class GenerateDialog(QWidget): 21 | 22 | def __init__(self, parent): 23 | self.u_info = parent.u_info 24 | self.parent = parent 25 | super().__init__() 26 | self.setWindowIcon(QIcon(path.join(icon_dir, 'Mojo2_16.png'))) 27 | self.initUI() 28 | 29 | def initUI(self): 30 | 31 | ## Dialog: Is Dojo activated? 32 | if self.u_info.files_found == False: 33 | QMessageBox.information(self, "3D Annotator", "Please open Dojo file!") 34 | return 35 | 36 | ## Dialog: Is the 3D Viewer already launched? 37 | #print( self.parent.table_widget.appl ) 38 | if 'annotator' in self.parent.table_widget.appl: 39 | QMessageBox.information(self, "3D Annotator", "3D Annotator has already been launched!") 40 | return 41 | 42 | ## New port 43 | self.u_info.port_stl = self.u_info.port_stl + 1 44 | ## 45 | ## ? Params.SetUserInfo(self, user_path) ? 46 | ## 47 | self.u_info.url_stl = 'http://' + self.u_info.ip + ':' + str(self.u_info.port_stl) + '/' 48 | 49 | ## Initialize 50 | self.parent.annotator = ControlAnnotatorServer(self.u_info) 51 | 52 | ## Start StlServer 53 | self.parent.annotator.LaunchAnnotator() 54 | 55 | ## Call StlViewer 56 | self.parent.table_widget.addTab('annotator', '3D Annotator', self.u_info.url_stl+'index.html' ) 57 | 58 | 59 | -------------------------------------------------------------------------------- /segment/_2D_DNN/_2D_DNN.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os, time, errno 5 | from PyQt5.QtWidgets import QWidget, QTabWidget, QVBoxLayout, QDialog 6 | from PyQt5.QtGui import QIcon 7 | from os import path, pardir 8 | 9 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 10 | icon_dir = path.join(main_dir, "icons") 11 | sys.path.append(main_dir) 12 | sys.path.append(path.join(main_dir, "segment")) 13 | sys.path.append(path.join(main_dir, "filesystem")) 14 | 15 | from miscellaneous.TabGenerator import TabGenerator 16 | from segment._2D_DNN.TrainingTab import TrainingTab 17 | from segment._2D_DNN.InferenceTab import InferenceTab 18 | 19 | 20 | class GenerateDialog(QDialog): 21 | def __init__(self, parent): 22 | super().__init__() 23 | self.left = 200 24 | self.top = 200 25 | self.width = 800 26 | self.height = 250 27 | self.comboText = None 28 | self.u_info = parent.u_info 29 | self.parent = parent 30 | self.title = "2D CNN" 31 | self.initUI() 32 | 33 | 34 | def initUI(self): 35 | 36 | ## 37 | ## Define tab 38 | ## 39 | self.layout = QVBoxLayout(self) 40 | tabs = QTabWidget() 41 | tabs.resize(300, 500) 42 | tab_source = TabGenerator(self) 43 | 44 | ## 45 | ## Training 46 | ## 47 | Training = TrainingTab(self.u_info) 48 | tab1 = tab_source.GenerateTabWidget(Training) # Widget 49 | tabs.addTab(tab1, "Training") 50 | 51 | ## 52 | ## Inference 53 | ## 54 | Inference = InferenceTab(self.u_info) 55 | tab2 = tab_source.GenerateTabWidget(Inference) # Widget 56 | tabs.addTab(tab2,"Inference") 57 | 58 | 59 | # Add tabs to widget 60 | self.layout.addWidget(tabs) 61 | self.setLayout(self.layout) 62 | 63 | 64 | self.setGeometry(self.left, self.top, self.width, self.height) 65 | self.setWindowTitle(self.title) 66 | self.setWindowIcon(QIcon(path.join(icon_dir, 'Mojo2_16.png'))) 67 | self.show() 68 | 69 | 70 | -------------------------------------------------------------------------------- /plugins/Template/Template.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os 5 | 6 | from PyQt5.QtWidgets import QTabWidget, QWidget, QVBoxLayout 7 | from PyQt5.QtGui import QIcon 8 | from os import path, pardir 9 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 10 | icon_dir = path.join(main_dir, "icons") 11 | sys.path.append(main_dir) 12 | from miscellaneous.TabGenerator import TabGenerator 13 | 14 | # ------------------------------------------------------------ 15 | # Example plugin 16 | # Please modify this tab widget for your own use. 17 | # Also edit Training.py and Inference.py 18 | # ------------------------------------------------------------ 19 | 20 | plugins_dir = path.join(main_dir, "plugins") 21 | sys.path.append(plugins_dir) 22 | from plugins.Template.Training import Training 23 | from plugins.Template.Inference import Inference 24 | 25 | 26 | class GenerateDialog(QWidget): 27 | def __init__(self, parent): 28 | self.title = "Template" 29 | self.left = 200 30 | self.top = 200 31 | self.width = 800 32 | self.height = 250 33 | self.u_info = parent.u_info 34 | self.parent = parent 35 | super().__init__() 36 | self.initUI() 37 | 38 | 39 | def initUI(self): 40 | 41 | # Generate tab 42 | tabs = QTabWidget() 43 | layout = QVBoxLayout() 44 | layout.addWidget(tabs) 45 | self.setLayout(layout) 46 | tab = TabGenerator(self) 47 | 48 | # Training 49 | training = Training(self.u_info) 50 | tab_training = tab.GenerateTabWidget(training) 51 | tabs.addTab(tab_training, 'Training') 52 | 53 | # Inferernce 54 | inference = Inference(self.u_info) 55 | tab_inference = tab.GenerateTabWidget(inference) 56 | tabs.addTab(tab_inference, 'Inference') 57 | 58 | # Show Widget 59 | self.setGeometry(self.left, self.top, self.width, self.height) 60 | self.setWindowTitle(self.title) 61 | self.setWindowIcon(QIcon(path.join(icon_dir, 'Mojo2_16.png'))) 62 | self.show() 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/json3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "json3", 3 | "version": "3.3.2", 4 | "description": "A modern JSON implementation compatible with nearly all JavaScript platforms.", 5 | "homepage": "http://bestiejs.github.io/json3", 6 | "main": "./lib/json3", 7 | "keywords": ["json", "spec", "ecma", "es5", "lexer", "parser", "stringify"], 8 | "licenses": [{ 9 | "type": "MIT", 10 | "url": "http://kit.mit-license.org/" 11 | }], 12 | "author": { 13 | "name": "Kit Cambridge", 14 | "email": "github@kitcambridge.be", 15 | "web": "http://kitcambridge.be/" 16 | }, 17 | "maintainers": [{ 18 | "name": "Kit Cambridge", 19 | "email": "github@kitcambridge.be", 20 | "web": "http://kitcambridge.be/" 21 | }, { 22 | "name": "Benjamin Tan", 23 | "email": "demoneaux@gmail.com", 24 | "web": "http://d10.github.io/" 25 | }], 26 | "contributors": [{ 27 | "name": "Mangled Deutz", 28 | "email": "olivier@webitup.fr", 29 | "web": "http://tech.roxee.tv/" 30 | }, { 31 | "name": "Øyvind Sean Kinsey", 32 | "email": "oyvind@kinsey.no", 33 | "web": "http://fb.me/ok" 34 | }, { 35 | "name": "Oskar Schöldström", 36 | "email": "public@oxy.fi", 37 | "web": "http://oxy.fi/" 38 | }, { 39 | "name": "Kiryl Yermakou", 40 | "email": "rma4ok@gmail.com", 41 | "web": "https://github.com/rma4ok" 42 | }], 43 | "bugs": { 44 | "url": "https://github.com/bestiejs/json3/issues" 45 | }, 46 | "scripts": { 47 | "test": "node test/test_*.js" 48 | }, 49 | "repository": { 50 | "type": "git", 51 | "url": "git://github.com/bestiejs/json3.git" 52 | }, 53 | "files": ["README.md", "LICENSE", "lib/json3.js", "lib/json3.min.js"], 54 | "jam": { 55 | "main": "./lib/json3.js", 56 | "includes": ["README.md", "LICENSE", "lib/json3.js", "lib/json3.min.js"] 57 | }, 58 | "volo": { 59 | "type": "directory", 60 | "ignore": [ 61 | ".*", 62 | "build.js", 63 | "index.html", 64 | "component.json", 65 | "bower.json", 66 | "benchmark", 67 | "page", 68 | "test", 69 | "vendor" 70 | ] 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/ffn/training/variables.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | """Customized variables for tracking ratios, rates, etc.""" 16 | 17 | from __future__ import absolute_import 18 | from __future__ import division 19 | from __future__ import print_function 20 | 21 | #import tensorflow.google as tf 22 | ## HU 23 | import pkg_resources 24 | ver = pkg_resources.get_distribution('tensorflow').version 25 | if ('1.15' in ver) |( '2.' in ver ): 26 | import tensorflow.compat.v1.google as tf 27 | tf.disable_v2_behavior() 28 | else: 29 | import tensorflow as tf 30 | ## 31 | 32 | 33 | class FractionTracker(object): 34 | """Helper for tracking fractions.""" 35 | 36 | def __init__(self, name='fraction'): 37 | # Values are: total, hits. 38 | self.var = tf.get_variable(name, [2], tf.int64, 39 | tf.constant_initializer([0, 0]), trainable=False) 40 | 41 | def record_miss(self): 42 | return self.var.assign_add([1, 0]) 43 | 44 | def record_hit(self): 45 | return self.var.assign_add([1, 1]) 46 | 47 | def get_hit_rate(self): 48 | total = self.var[0] 49 | hits = self.var[1] 50 | hit_rate = (tf.cast(hits, tf.float32) / 51 | tf.maximum(tf.constant(1, dtype=tf.float32), 52 | tf.cast(total, tf.float32))) 53 | 54 | with tf.control_dependencies([hit_rate]): 55 | update_var = self.var.assign_add([-total, -hits]) 56 | with tf.control_dependencies([update_var]): 57 | return tf.identity(hit_rate) 58 | -------------------------------------------------------------------------------- /segment/_tensorb/_tensorb.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os 5 | 6 | 7 | from PyQt5.QtWidgets import QMessageBox, QWidget, QFileDialog 8 | import subprocess as s 9 | import socket 10 | import time 11 | 12 | from os import path, pardir 13 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 14 | sys.path.append(main_dir) 15 | 16 | 17 | class GenerateDialog(QWidget): 18 | def __init__(self, parent): 19 | self.u_info = parent.u_info 20 | self.parent = parent 21 | super().__init__() 22 | self.initUI() 23 | 24 | def initUI(self): 25 | 26 | ## Dialog: Is Tensorboard already launched? 27 | #print(self.parent.table_widget.appl) 28 | if 'tensorboard' in self.parent.table_widget.appl: 29 | QMessageBox.information(self, "Tensorboard", "Tensorboard has already been launched!") 30 | return 31 | 32 | ## Select Tensorboard Folder 33 | newdir = QFileDialog.getExistingDirectory( self, "Select tensorboard folder", self.u_info.data_path ) 34 | if len(newdir) == 0: 35 | print('No folder was selected.') 36 | return 37 | 38 | ## Tensorboard launch. 39 | return self.StartTensorboard(newdir) 40 | 41 | 42 | def StartTensorboard(self, newdir): 43 | 44 | tmp = [ \ 45 | '--logdir' , newdir , \ 46 | '--host' , socket.gethostbyname(socket.gethostname()) ] 47 | comm = self.u_info.exec_tensorboard[:] 48 | comm.extend( tmp ) 49 | 50 | print(comm) 51 | 52 | try: 53 | self.parent.process_tensorboard = s.Popen(comm, stdout=s.PIPE) 54 | time.sleep(1) 55 | self.parent.table_widget.addTab('tensorboard', 'Tensorboard', 56 | 'http://' + socket.gethostbyname(socket.gethostname()) + ':6006/') 57 | print("Start tensorboard") 58 | return True 59 | except s.CalledProcessError as e: 60 | print("Error ocurrs in tensorboard") 61 | return False 62 | 63 | # def CloseTensorboard(self): 64 | # self.p.terminate() 65 | # print("Stop tensorboard") 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/es6-shim/es6-sham.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["es6-sham.js"],"names":["root","factory","define","amd","exports","module","returnExports","this","getGlobal","Function","globals","Object","_call","call","bind","functionToString","toString","_strMatch","String","prototype","match","throwsError","func","e","arePropertyDescriptorsSupported","defineProperty","get","supportsDescriptors","setPrototypeOf","getOwnPropertyNames","getOwnPropertyDescriptor","create","getPrototypeOf","objProto","copyDescriptors","target","source","forEach","key","createAndCopy","origin","proto","set","__proto__","foo","name","configurable","enumerable","str","writable","value"],"mappings":";;;;;;;;;CAYC,SAAUA,EAAMC,GAEf,SAAWC,UAAW,YAAcA,OAAOC,IAAK,CAE9CD,OAAOD,OACF,UAAWG,WAAY,SAAU,CAItCC,OAAOD,QAAUH,QACZ,CAELD,EAAKM,cAAgBL,OAEvBM,KAAM,WACN,YAIA,IAAIC,GAAY,GAAIC,UAAS,eAI7B,IAAIC,GAAUF,GACd,IAAIG,GAASD,EAAQC,MACrB,IAAIC,GAAQH,SAASI,KAAKC,KAAKL,SAASI,KACxC,IAAIE,GAAmBN,SAASO,QAChC,IAAIC,GAAYC,OAAOC,UAAUC,KAEjC,IAAIC,GAAc,SAAUC,GAC1B,IACEA,GACA,OAAO,OACP,MAAOC,GACP,MAAO,OAGX,IAAIC,GAAkC,WAEpC,OAAQH,EAAY,WAClBV,EAAOc,kBAAmB,KAAOC,IAAK,iBAG1C,IAAIC,KAAwBhB,EAAOc,gBAAkBD,KAWpD,WACC,GAAIb,EAAOiB,eAAgB,CAAE,OAK7B,GAAIC,GAAsBlB,EAAOkB,mBACjC,IAAIC,GAA2BnB,EAAOmB,wBACtC,IAAIC,GAASpB,EAAOoB,MACpB,IAAIN,GAAiBd,EAAOc,cAC5B,IAAIO,GAAiBrB,EAAOqB,cAC5B,IAAIC,GAAWtB,EAAOQ,SAEtB,IAAIe,GAAkB,SAAUC,EAAQC,GAEtCP,EAAoBO,GAAQC,QAAQ,SAAUC,GAC5Cb,EACEU,EACAG,EACAR,EAAyBM,EAAQE,KAGrC,OAAOH,GAGT,IAAII,GAAgB,SAAUC,EAAQC,GACpC,MAAOP,GAAgBH,EAAOU,GAAQD,GAExC,IAAIE,GAAKd,CACT,KAGEc,EAAMZ,EAAyBG,EAAU,aAAaS,GACtDA,GAAI7B,QAAS,KAGbe,GAAiB,SAAUY,EAAQC,GACjCC,EAAI7B,KAAK2B,EAAQC,EACjB,OAAOD,IAET,MAAOjB,GAEPmB,GAAQC,UAAW,KAGnB,IAAID,YAAe/B,GAAQ,CACzBiB,EAAiBW,MACZ,CAGLG,EAAIC,UAAYV,CAIhB,IAAIS,YAAe/B,GAAQ,CACzBiB,EAAiB,SAAUY,EAAQC,GAGjCD,EAAOG,UAAYF,CAEnB,OAAOD,QAEJ,CAGLZ,EAAiB,SAAUY,EAAQC,GAEjC,GAAIT,EAAeQ,GAAS,CAG1BA,EAAOG,UAAYF,CAEnB,OAAOD,OACF,CAEL,MAAOD,GAAcC,EAAQC,OAMvC9B,EAAOiB,eAAiBA,KAG1B,IAAID,GAAuB,QAASiB,SAASC,OAAS,MAAO,CAE3DlC,EAAOc,eAAehB,SAASU,UAAW,QACxC2B,aAAc,KACdC,WAAY,MACZrB,IAAK,WACH,GAAIsB,GAAMpC,EAAMG,EAAkBR,KAClC,IAAIa,GAAQR,EAAMK,EAAW+B,EAAK,6BAClC,IAAIH,GAAOzB,GAASA,EAAM,EAC1BT,GAAOc,eAAelB,KAAM,QAC1BuC,aAAc,KACdC,WAAY,MACZE,SAAU,MACVC,MAAOL,GAET,OAAOA"} -------------------------------------------------------------------------------- /_web_dojo/gui/js/src/config.js: -------------------------------------------------------------------------------- 1 | // 共通設定 2 | 3 | /** 4 | * canvasの幅と高さ 5 | * 6 | * 定義元: 7 | * _web/viewer.js 8 | * this._segmentation_buffer.width 9 | * this._segmentation_buffer.height 10 | * this._offscreen_buffer.width 11 | * this._offscreen_buffer.height 12 | * 他、直接ソース上に512と記述されてるところ 13 | */ 14 | 15 | // canvasの幅 16 | export const DOJO_CANVAS_BUFFER_WIDTH = 512; 17 | 18 | // canvasの高さ 19 | export const DOJO_CANVAS_BUFFER_HEIGHT = 512; 20 | 21 | 22 | /** 23 | * slice 24 | * 25 | * コマンド: 26 | * 87: W SLICE UP 27 | * 83: S SLICE DOWN 28 | * 29 | * 定義元: 30 | * _web/camera.js 31 | * J.camera.prototype.slice_up 32 | * J.camera.prototype.slice_down 33 | * 34 | * _web/dojo.js 35 | * DOJO.update_slice_number 36 | */ 37 | 38 | // sliceスライダーの最小値 39 | // 最大値はdojoの読み込みが完了したときのイベント_onDojoImageLoadCompleteで設定する 40 | export const SLICE_SLIDER_MIN_VALUE = 1; 41 | 42 | // sliceスライダーを動かすといくつ動くか 43 | export const SLICE_SLIDER_STEP = 1; 44 | 45 | // sliceスライダーの初期値 46 | export const SLICE_SLIDER_DEFAULT_VALUE = 1; 47 | 48 | /** 49 | * opacity 50 | * 51 | * コマンド: 52 | * 189: - DECREASE OPACITY 53 | * 187: = INCREASE OPACITY 54 | * 55 | * 定義元: 56 | * _web/viewer.js 57 | * J.viewer.prototype.increase_opacity 58 | * J.viewer.prototype.decrease_opacity 59 | * this._overlay_opacity 60 | */ 61 | 62 | // opacityスライダーの最小値 63 | export const OPACITY_SLIDER_MIN_VALUE = 0; 64 | 65 | // opacityスライダーの最大値 66 | export const OPACITY_SLIDER_MAX_VALUE = 255; 67 | 68 | // opacityスライダーを動かすといくつ動くか 69 | export const OPACITY_SLIDER_STEP = 20; 70 | 71 | // opacityスライダーの初期値 72 | export const OPACITY_SLIDER_DEFAULT_VALUE = 100; 73 | 74 | /** 75 | * zoom 76 | * 77 | * コマンド: 78 | * 67: C ZOOM IN 79 | * 88: X ZOOM OUT 80 | * 81 | * 定義元: 82 | * _web/camera.js 83 | * J.camera.prototype.zoom 84 | */ 85 | 86 | // zoomスライダーの最小値 87 | export const ZOOM_SLIDER_MIN_VALUE = 1; 88 | 89 | // zoomスライダーの最大値 90 | // 本来camera.jsのfuture_zoom_levelを使うが、バグがあるため 91 | // 初期状態から何回ズームできるかを単純に数えた数 92 | export const ZOOM_SLIDER_MAX_VALUE = 13; 93 | 94 | // zoomスライダーを動かすといくつ動くか 95 | export const ZOOM_SLIDER_STEP = 1; 96 | 97 | // zoomスライダーの初期値 98 | export const ZOOM_SLIDER_DEFAULT_VALUE = 2; 99 | -------------------------------------------------------------------------------- /dojo/image.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | from io import BytesIO 4 | from datasource import Datasource 5 | import numpy as np 6 | import zlib 7 | import cv2 8 | import miscellaneous.Miscellaneous as m 9 | 10 | class Image(Datasource): 11 | 12 | def __init__(self, mojo_dir, tmp_dir): 13 | ''' 14 | @override 15 | ''' 16 | query = 'image' 17 | input_format = None # input_format = None 180905 18 | output_format = 'jpg' 19 | sub_dir = 'images' 20 | 21 | super(Image, self).__init__(mojo_dir, tmp_dir, query, input_format, output_format, sub_dir) 22 | 23 | def get_volume(self, zoomlevel): 24 | ''' 25 | @override 26 | ''' 27 | files = super().get_volume(zoomlevel) 28 | 29 | out = None 30 | out_is_there = False 31 | 32 | # Sample all slices or a maximum number of z slices from all files 33 | for i in np.linspace(0,len(files)-1, num=min(len(files),self._Datasource__zSample_max)).astype('int'): 34 | 35 | print(files[i]) ################################################## 36 | input_image = m.imread(files[i], cv2.IMREAD_GRAYSCALE) 37 | 38 | if out_is_there: 39 | #out = np.dstack([out, input_image]) 40 | out = np.concatenate([out, input_image.flatten()]) 41 | else: 42 | #out = input_image 43 | out = input_image.flatten() 44 | out_is_there = True 45 | 46 | c_image_data = zlib.compress(out) 47 | 48 | output = BytesIO() 49 | output.write(c_image_data) 50 | 51 | content = output.getvalue() 52 | content_type = 'application/octstream' 53 | 54 | return content, content_type 55 | 56 | def get_tile(self, file): 57 | ''' 58 | @override 59 | ''' 60 | super().get_tile(file) 61 | 62 | image_data = m.imread(file, cv2.IMREAD_GRAYSCALE) 63 | #if image_data.mode != "RGB": ##### 64 | # image_data = image_data.convert("RGB") ##### 65 | 66 | #print(image_data) 67 | 68 | 69 | content = cv2.imencode('.jpg', image_data, [cv2.IMWRITE_JPEG_QUALITY, 90])[1].tostring() 70 | 71 | content_type = 'image/jpeg' 72 | 73 | return content, content_type 74 | 75 | def handle(self, request): 76 | ''' 77 | @override 78 | ''' 79 | return super().handle(request) 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/src/dojo-gui.js: -------------------------------------------------------------------------------- 1 | import {HeaderToolbar} from './header-toolbar'; 2 | import {SliceSlider} from './slice-slider'; 3 | import {OpacitySlider} from './opacity-slider'; 4 | import {ZoomSlider} from './zoom-slider'; 5 | 6 | export class DojoGUI { 7 | constructor() { 8 | this._elementsInitialized = false; 9 | } 10 | 11 | init() { 12 | EventBus.addEventListener('DOJO:loading', (...args) => this.onDojoLoading(...args)); 13 | EventBus.addEventListener('DOJO:merge', (...args) => this.onDojoMerge(...args)); 14 | EventBus.addEventListener('DOJO:startSplit', (...args) => this.onDojoStartSplit(...args)); 15 | EventBus.addEventListener('DOJO:resetTools', (...args) => this.onDojoResetTools(...args)); 16 | } 17 | 18 | onDojoLoading(event, isReady) { 19 | if (isReady && !this._elementsInitialized) { 20 | this._elementsInitialized = true; 21 | this.initElements(); 22 | } 23 | } 24 | 25 | initElements() { 26 | this.headerToolbar = new HeaderToolbar(); 27 | this.sliceSlider = new SliceSlider(); 28 | this.opacitySlider = new OpacitySlider(); 29 | this.zoomSlider = new ZoomSlider(); 30 | } 31 | 32 | /** 33 | * camera用のスライダーを有効化 34 | */ 35 | enableCameraSliders() { 36 | this.sliceSlider.el.bootstrapSlider('enable'); 37 | this.zoomSlider.el.bootstrapSlider('enable'); 38 | } 39 | 40 | /** 41 | * camera用のスライダーを無効化 42 | */ 43 | disableCameraSliders() { 44 | this.sliceSlider.el.bootstrapSlider('disable'); 45 | this.zoomSlider.el.bootstrapSlider('disable'); 46 | } 47 | 48 | /** 49 | * Margeモードに切り替わった時のイベント 50 | * 51 | * @param {Object} event イベントオブジェクト 52 | * @param {number} id merge時に渡されるパラメータ 53 | */ 54 | onDojoMerge(event, id) { 55 | this.disableCameraSliders(); 56 | } 57 | 58 | /** 59 | * Splitモードに切り替わった時のイベント 60 | * 61 | * @param {Object} event イベントオブジェクト 62 | * @param {number} id split時に渡されるパラメータ 63 | * @param {number} x split時に渡されるパラメータ 64 | * @param {number} y split時に渡されるパラメータ 65 | */ 66 | onDojoStartSplit(event, id, x, y) { 67 | this.disableCameraSliders(); 68 | } 69 | 70 | /** 71 | * DOJO.reset_toolsが実行された時のイベント 72 | * 73 | * @param {Object} event イベントオブジェクト 74 | */ 75 | onDojoResetTools() { 76 | this.enableCameraSliders(); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/ffn/training/import_util.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | """Contains a utility function for dynamically importing symbols from modules. 16 | """ 17 | 18 | from __future__ import absolute_import 19 | from __future__ import division 20 | from __future__ import print_function 21 | 22 | import importlib 23 | import logging 24 | 25 | import sys 26 | from os import path 27 | main_dir = path.abspath(path.dirname(sys.argv[0])) 28 | current_dir = path.join(main_dir,"ffn","training") 29 | sys.path.append(current_dir) 30 | import convstack_3d 31 | 32 | def import_symbol(specifier, default_packages='ffn.training.models'): 33 | """Imports a symbol from a python module. 34 | 35 | The calling module must have the target module for the import as dependency. 36 | 37 | Args: 38 | specifier: full path specifier in format 39 | [.]., if packages is missing 40 | ``default_packages`` is used. 41 | default_packages: chain of packages before module in format 42 | .. etc. 43 | 44 | Returns: 45 | symbol: object from module 46 | """ 47 | module_path, symbol_name = specifier.rsplit('.', 1) 48 | # try: 49 | # logging.info('Importing symbol %s from %s.%s', 50 | # symbol_name, default_packages, module_path) 51 | # module = importlib.import_module(default_packages + '.' + module_path) 52 | # except ImportError as e: 53 | # logging.info(e) 54 | # logging.info('Importing symbol %s from %s', symbol_name, module_path) 55 | # module = importlib.import_module(module_path) 56 | 57 | symbol = getattr(convstack_3d, symbol_name) 58 | return symbol 59 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/eventbus/eventbus.min.js: -------------------------------------------------------------------------------- 1 | (function(root,factory){if(typeof exports==="object"&&typeof module==="object")module.exports=factory();else if(typeof define==="function"&&define.amd)define("EventBus",[],factory);else if(typeof exports==="object")exports["EventBus"]=factory();else root["EventBus"]=factory()})(this,function(){var EventBusClass={};EventBusClass=function(){this.listeners={}};EventBusClass.prototype={addEventListener:function(type,callback,scope){var args=[];var numOfArgs=arguments.length;for(var i=0;i3?args.splice(3,args.length-1):[];if(typeof this.listeners[type]!="undefined"){this.listeners[type].push({scope:scope,callback:callback,args:args})}else{this.listeners[type]=[{scope:scope,callback:callback,args:args}]}},removeEventListener:function(type,callback,scope){if(typeof this.listeners[type]!="undefined"){var numOfCallbacks=this.listeners[type].length;var newArray=[];for(var i=0;i0}for(var i=0;i2?args.splice(2,args.length-1):[];args=[event].concat(args);if(typeof this.listeners[type]!="undefined"){var listeners=this.listeners[type].slice();var numOfCallbacks=listeners.length;for(var i=0;i", 59 | "license": "MIT", 60 | "bugs": { 61 | "url": "https://github.com/polygonplanet/chillout/issues" 62 | }, 63 | "homepage": "https://github.com/polygonplanet/chillout" 64 | } 65 | -------------------------------------------------------------------------------- /plugins/Template/Training.py: -------------------------------------------------------------------------------- 1 | ## 2 | ## 3 | import sys, os 4 | import subprocess as s 5 | from PyQt5.QtCore import Qt 6 | import miscellaneous.Miscellaneous as m 7 | 8 | from os import path, pardir 9 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 10 | # exec_template = ['python', os.path.join(main_dir, 'plugins', 'Template', 'run_example.py')] 11 | 12 | 13 | class Training(): 14 | def _Run(self, parent, params, comm_title): 15 | ## 16 | if params['Sparse Z'] != Qt.Unchecked: 17 | print('Sparse Z : checked') 18 | else: 19 | print('Sparse Z : unchecked') 20 | print('Checkpoint Interval: ', params['Checkpoint Interval']) 21 | print('Mode : ', params['Mode']) 22 | ## 23 | tmp = [ '--training_image_folder' , params['Training image folder'] , \ 24 | '--ground_truth_folder' , params['Ground truth folder'] , \ 25 | '--tensorflow_model_file' , params['Model Folder (Empty/Model)'] ] 26 | comm_run = self.u_info.exec_template[:] 27 | comm_run.extend( tmp ) 28 | ## 29 | print('') 30 | print(' '.join(comm_run)) 31 | print('') 32 | s.run(comm_run) 33 | print(comm_title, 'was finished.\n') 34 | return True 35 | 36 | 37 | def __init__(self, u_info): 38 | ## 39 | self.u_info = u_info 40 | 41 | self.paramfile = os.path.join(u_info.parameters_path, "Training.pickle") 42 | 43 | self.title = 'Training' 44 | 45 | self.tips = [ 46 | 'Input : Training image folder', 47 | 'Input : Ground truth folder', 48 | 'Input/Output: Tensorlflow Model Folder', 49 | 'Checkpoint Interval', 50 | 'Sparse Z', 51 | 'Mode' 52 | ] 53 | 54 | self.args = [ 55 | ['Training image folder', 'SelectImageFolder', 'OpenImageFolder'], 56 | ['Ground truth folder', 'SelectImageFolder', 'OpenImageFolder'], 57 | ['Model Folder (Empty/Model)', 'SelectEmptyModelFolder', 'OpenEmptyModelFolder'], 58 | ['Checkpoint Interval', 'SpinBox', [100, 1800, 65535]], 59 | ['Sparse Z', 'CheckBox', False], 60 | ['Mode', 'ComboBox', ['a','b','c']] 61 | ] 62 | 63 | -------------------------------------------------------------------------------- /segment/_2D_DNN/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright for portions of project imagesegmentation-tensorflow are held by Christopher Hesse, 2017 2 | as part of project pix2pix-tensorflow, see (1). All other copyright for project 3 | imagetranslation-tensorflow are held by Torsten Bullmann, 2017, see (2). 4 | 5 | (2) 6 | MIT License 7 | 8 | Copyright (c) 2017 Torsten Bullmann 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | (1) 29 | MIT License 30 | 31 | Copyright (c) 2017 Christopher Hesse 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining a copy 34 | of this software and associated documentation files (the "Software"), to deal 35 | in the Software without restriction, including without limitation the rights 36 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 37 | copies of the Software, and to permit persons to whom the Software is 38 | furnished to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in all 41 | copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 45 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 46 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 47 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 48 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 49 | SOFTWARE. 50 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/ffn/utils/vector.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Google Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // https://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // ============================================================================== 15 | // Defines protocol messages representing vectors. 16 | 17 | syntax = "proto2"; 18 | 19 | package ffn.proto; 20 | 21 | // A vector of two 64-bit floating point numbers. 22 | message Vector2d { 23 | optional double x = 1; // required 24 | optional double y = 2; // required 25 | }; 26 | 27 | // A vector of two 32-bit signed integers. 28 | message Vector2i { 29 | optional int32 x = 1; // required 30 | optional int32 y = 2; // required 31 | }; 32 | 33 | // A vector of three 64-bit floating point numbers. 34 | message Vector3d { 35 | optional double x = 1; // required 36 | optional double y = 2; // required 37 | optional double z = 3; // required 38 | }; 39 | 40 | // A vector of three 32-bit floating point numbers. 41 | message Vector3f { 42 | optional float x = 1; // required 43 | optional float y = 2; // required 44 | optional float z = 3; // required 45 | }; 46 | 47 | // A vector of three 64-bit signed integers. The "j" suffix follows the Java 48 | // type naming convention, for lack of a more suitable one. 49 | message Vector3j { 50 | optional int64 x = 1; // required 51 | optional int64 y = 2; // required 52 | optional int64 z = 3; // required 53 | }; 54 | 55 | // A list of 2-dimensional 64-bit floating point vectors. 56 | message Vector2dList { 57 | repeated Vector2d vectors = 1; 58 | }; 59 | 60 | // A list of 2-dimensional 32-bit integer vectors. 61 | message Vector2iList { 62 | repeated Vector2i vectors = 1; 63 | }; 64 | 65 | // A list of 3-dimensional 64-bit floating point vectors. 66 | message Vector3dList { 67 | repeated Vector3d vectors = 1; 68 | }; 69 | 70 | // A list of 3-dimensional 32-bit floating point vectors. 71 | message Vector3fList { 72 | repeated Vector3f vectors = 1; 73 | }; 74 | 75 | // A list of 3-dimensional 64-bit integer vectors. 76 | message Vector3jList { 77 | repeated Vector3j vectors = 1; 78 | }; 79 | -------------------------------------------------------------------------------- /plugins/miscellaneous/FilterlistGenerator.py: -------------------------------------------------------------------------------- 1 | import sys, os, time, errno 2 | 3 | import numpy as np 4 | import copy 5 | 6 | from miscellaneous.ListManager import ListManager 7 | from Filter2D3D.FiltersInfo import FilterInfo 8 | 9 | from PyQt5.QtWidgets import QWidget, QHBoxLayout, QLabel, QPushButton, QVBoxLayout 10 | from PyQt5.QtGui import QIcon, QPixmap, QPainter, QColor, QFont, QStandardItemModel 11 | from PyQt5.QtCore import Qt, pyqtSlot, QStringListModel, QEvent 12 | 13 | 14 | import PyQt5.QtCore as QtCore 15 | import PyQt5.QtGui as QtGui 16 | import PyQt5.QtWidgets as QtWidgets 17 | 18 | 19 | from os import path, pardir 20 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 21 | sys.path.append(main_dir) 22 | from miscellaneous.MiscellaneousFilters import MiscellaneousFilters 23 | 24 | 25 | class FilterlistGenerator(MiscellaneousFilters): 26 | 27 | def _title(self, text): 28 | bold = QFont() 29 | bold.setBold(True) 30 | ql = QLabel(text) 31 | ql.setFont(bold) 32 | ql.setAlignment(Qt.AlignTop) 33 | ql.setMaximumHeight(20) 34 | return ql 35 | 36 | def __init__(self, parent): 37 | self.parent = parent 38 | 39 | 40 | def GenerateFilterlistObject(self): 41 | ## 42 | ## 43 | fi = FilterInfo() 44 | _2D_Filters = fi.get_2d_filter_name_list() 45 | _3D_Filters = fi.get_3d_filter_name_list() 46 | 47 | ## 48 | ## Canvas 49 | ## 50 | layout1 = QVBoxLayout() 51 | layout2 = QVBoxLayout() 52 | layout2_1 = QVBoxLayout() 53 | layout2_2 = QVBoxLayout() 54 | self.listManager = ListManager(self) 55 | ## 56 | layout1.addWidget(self._title("2D Filter")) 57 | self.listManager.addSource(layout1, _2D_Filters) 58 | ## 59 | layout1.addWidget(self._title("3D Filter")) 60 | self.listManager.addSource(layout1, _3D_Filters) 61 | ## 62 | layout2_1.addWidget(self._title("Filter Application"), alignment=Qt.AlignTop) 63 | self.listManager.addTarget(layout2_1) 64 | layout2_1.setAlignment(Qt.AlignTop) 65 | ## 66 | self.listManager.addParameter(layout2_1) 67 | ## 68 | b = QPushButton("Obtain sample output") 69 | b.clicked.connect(self.parent.obtainSample) 70 | layout2_2.addWidget(b, alignment=Qt.AlignBottom) 71 | 72 | layout2.addLayout(layout2_1) 73 | layout2.addLayout(layout2_2) 74 | 75 | self.parent.targetWidget = self.listManager.widgets[2] 76 | 77 | ## 78 | layout = QHBoxLayout() 79 | layout.addLayout(layout1) 80 | layout.addLayout(layout2) 81 | 82 | ### Generate objects 83 | filterlist = QWidget() 84 | filterlist.setLayout(layout) 85 | 86 | return filterlist 87 | 88 | -------------------------------------------------------------------------------- /segment/_3D_FFN/_3D_FFN.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | 5 | import sys, os, time, errno 6 | 7 | from PyQt5.QtWidgets import QWidget, QTabWidget, QVBoxLayout 8 | from PyQt5.QtGui import QIcon 9 | 10 | from os import path, pardir 11 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 12 | sys.path.append(main_dir) 13 | from miscellaneous.TabGenerator import TabGenerator 14 | 15 | icon_dir = path.join(main_dir, "icons") 16 | _3D_FFN_dir = path.join(main_dir, "segment",'_3D_FFN') 17 | sys.path.append(_3D_FFN_dir) 18 | from segment._3D_FFN.FFNPrepTraining import FFNPrepTraining 19 | from segment._3D_FFN.FFNTraining import FFNTraining 20 | from segment._3D_FFN.FFNInference import FFNInference 21 | from segment._3D_FFN.FFNPostprocessing import FFNPostprocessing 22 | 23 | segmentation_dir = path.join(main_dir, "segment") 24 | sys.path.append(segmentation_dir) 25 | 26 | 27 | class GenerateDialog(QWidget): 28 | def __init__(self, parent): 29 | super().__init__() 30 | self.left = 200 31 | self.top = 200 32 | self.width = 800 33 | self.height = 250 34 | self.comboText = None 35 | self.u_info = parent.u_info 36 | self.parent = parent 37 | self.title = "3D FFN" 38 | self.initUI() 39 | 40 | 41 | def initUI(self): 42 | ## 43 | ## Define tab 44 | ## 45 | layout = QVBoxLayout() 46 | tabs = QTabWidget() 47 | tabs.resize(300, 500) 48 | tab = TabGenerator(self) 49 | 50 | ## 51 | ## FFN preparation 52 | ## 53 | prep_ffn = FFNPrepTraining(self.u_info) 54 | Widget1_bottom = tab.GenerateTabWidget(prep_ffn) # Widget 55 | tabs.addTab(Widget1_bottom, 'Preprocessing') 56 | 57 | ## 58 | ## FFN training 59 | ## 60 | run_ffn = FFNTraining(self.u_info) 61 | Widget2_bottom = tab.GenerateTabWidget(run_ffn) # Widget 62 | tabs.addTab(Widget2_bottom, 'Training') 63 | 64 | ## 65 | ## FFN inferernce 66 | ## 67 | run_ffn = FFNInference(self.u_info) 68 | Widget3_bottom = tab.GenerateTabWidget(run_ffn) # Widget 69 | tabs.addTab(Widget3_bottom, 'Inference') 70 | 71 | ## 72 | ## FFN postprocessing 73 | ## 74 | run_ffn = FFNPostprocessing(self.u_info) 75 | Widget4_bottom = tab.GenerateTabWidget(run_ffn) # Widget 76 | tabs.addTab(Widget4_bottom, 'Postprocessing') 77 | 78 | ## 79 | ## Generate tabs 80 | ## 81 | 82 | layout.addWidget(tabs) 83 | self.setLayout(layout) 84 | 85 | 86 | self.setGeometry(self.left, self.top, self.width, self.height) 87 | self.setWindowTitle(self.title) 88 | self.setWindowIcon(QIcon(path.join(icon_dir, 'Mojo2_16.png'))) 89 | self.show() 90 | 91 | ## 92 | -------------------------------------------------------------------------------- /segment/_2D_DNN/TrainingTab.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os, time, errno 5 | from os import path, pardir 6 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 7 | sys.path.append(main_dir) 8 | sys.path.append(path.join(main_dir, "segment")) 9 | sys.path.append(path.join(main_dir, "system")) 10 | 11 | from _2D_DNN.TrainingExe import TrainingExe 12 | 13 | class TrainingTab(TrainingExe): 14 | def __init__(self, u_info): 15 | 16 | self.paramfile = os.path.join( u_info.parameters_path, "Training_2D.pickle") 17 | 18 | self.title = '2D Training' 19 | 20 | self.tips = [ 21 | 'Path to folder containing images', 22 | 'Path to folder containing segmentation', 23 | 'Empty folder tensorflow model. Currently, additional training is not allowed, so the only empty folder is accepted.', 24 | 'Network topology', 25 | 'Depth of U-net (maximum 8)', 26 | 'Number of residual blocks in res net', 27 | 'Number of highway units in highway net', 28 | 'Number of dense blocks in dense net', 29 | 'Number of dense connected layers in each block of the dense net', 30 | 'Number of images in batch', 31 | 'Loss Function', 32 | 'Number of training epochs', 33 | 'Write current training images every display frequency steps', 34 | 'Dimensions for Augmentation' 35 | ] 36 | 37 | self.args = [ 38 | ['Image Folder', 'SelectImageFolder', 'OpenImageFolder'], 39 | ['Segmentation Folder', 'SelectImageFolder', 'OpenImageFolder'], 40 | ['Model Folder (Empty)', 'SelectEmptyFolder', 'OpenEmptyFolder'], 41 | ['Network', 'Tab', ['unet', 'resnet', 'highwaynet', 'densenet'], [0,1,2,3,3] ], 42 | ['U depth','SpinBox',[1,8,20]], 43 | ['N res blocks','SpinBox',[1,9,255]], 44 | ['N highway units','SpinBox',[1,9,255]], 45 | ['N dense blocks','SpinBox',[1,5,255]], 46 | ['N dense layers','SpinBox',[1,5,255]], 47 | ['Batch Size', 'SpinBox', [1, 1, 65535]], 48 | ['Loss Function', 'ComboBox', ["softmax", "hinge", "square", "approx", "dice", "logistic"]], 49 | ['Maximal Epochs', 'SpinBox', [1, 2000, 65535]], 50 | ['Display Frequency', 'SpinBox', [0, 200, 65535]], 51 | ['Augmentation', 'ComboBox', ["fliplr, flipud, transpose", "fliplr, flipud", "fliplr", "flipud", "None"]] 52 | ] 53 | 54 | 55 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/es7-shim/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "es7-shim", 3 | "version": "6.0.0", 4 | "description": "ECMAScript 7 compatibility shims for legacy JavaScript engines", 5 | "homepage": "http://github.com/es-shims/es7-shim/", 6 | "author": "Jordan Harband (https://github.com/ljharb/)", 7 | "contributors": [ 8 | "Jordan Harband (https://github.com/ljharb/)" 9 | ], 10 | "bugs": { 11 | "mail": "ljharb@gmail.com", 12 | "url": "http://github.com/es-shims/es7-shim/issues" 13 | }, 14 | "license": "MIT", 15 | "main": "index.js", 16 | "browser": "browser.js", 17 | "repository": { 18 | "type": "git", 19 | "url": "http://github.com/es-shims/es7-shim.git" 20 | }, 21 | "keywords": [ 22 | "ecmascript", 23 | "harmony", 24 | "es7", 25 | "ES2016", 26 | "shim", 27 | "polyfill" 28 | ], 29 | "scripts": { 30 | "pretest": "npm run --silent lint", 31 | "test": "npm run --silent tests-only", 32 | "posttest": "npm run --silent security", 33 | "tests-only": "node test/index.js", 34 | "prepublish": "npm run --silent minify", 35 | "build": "mkdir -p dist && browserify ./ > dist/es7-shim.js", 36 | "minify": "npm run --silent build && uglifyjs dist/es7-shim.js --comments --source-map=dist/es7-shim.map -m -b ascii_only=true,beautify=false > dist/es7-shim.min.js", 37 | "coverage": "covert test/index.js", 38 | "coverage-quiet": "covert test/index.js --quiet", 39 | "lint": "parallelshell 'npm run --silent jscs' 'npm run --silent eslint'", 40 | "jscs": "jscs test/index.js *.js", 41 | "eslint": "eslint test/index.js *.js", 42 | "security": "nsp check" 43 | }, 44 | "dependencies": { 45 | "array-includes": "^3.0.2", 46 | "object.getownpropertydescriptors": "^2.0.2", 47 | "object.entries": "^1.0.3", 48 | "object.values": "^1.0.3", 49 | "string-at": "^1.0.1", 50 | "string.prototype.padstart": "^3.0.0", 51 | "string.prototype.padend": "^3.0.0", 52 | "string.prototype.trimleft": "^2.0.0", 53 | "string.prototype.trimright": "^2.0.0" 54 | }, 55 | "devDependencies": { 56 | "tape": "^4.6.0", 57 | "browserify": "^13.0.1", 58 | "uglify-js": "^2.7.0", 59 | "covert": "^1.1.0", 60 | "jscs": "^3.0.6", 61 | "nsp": "^2.5.0", 62 | "eslint": "^3.0.1", 63 | "@ljharb/eslint-config": "^6.0.0", 64 | "es6-promise": "^3.2.1", 65 | "semver": "^5.2.0", 66 | "replace": "^0.3.0", 67 | "parallelshell": "^2.0.0" 68 | }, 69 | "engines": { 70 | "node": ">=0.4.0" 71 | }, 72 | "testling": { 73 | "files": "test/index.js", 74 | "browsers": [ 75 | "iexplore/6.0..latest", 76 | "firefox/3.0..6.0", 77 | "firefox/15.0..latest", 78 | "firefox/nightly", 79 | "chrome/4.0..10.0", 80 | "chrome/20.0..latest", 81 | "chrome/canary", 82 | "opera/10.0..latest", 83 | "opera/next", 84 | "safari/4.0..latest", 85 | "ipad/6.0..latest", 86 | "iphone/6.0..latest", 87 | "android-browser/4.2" 88 | ] 89 | } 90 | } 91 | 92 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/ffn/utils/geom_utils.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | """Utilities for working with geometry objects.""" 16 | 17 | import numpy 18 | from . import vector_pb2 19 | 20 | 21 | def ToVector3j(*args): 22 | """Converts from *args to Vector3j. 23 | 24 | Args: 25 | *args: Can either be three separate ints, or a single sequence arg, or a 26 | single Vector3j arg. No-op if already Vector3j. 27 | 28 | Returns: 29 | New Vector3j. 30 | 31 | Raises: 32 | Exception: Bad input. 33 | """ 34 | if len(args) == 3: 35 | seq = args 36 | elif len(args) == 1: 37 | seq = args[0] 38 | else: 39 | raise ValueError('Expected three ints, a 3-sequence of ints, or a Vector3j') 40 | 41 | if isinstance(seq, vector_pb2.Vector3j): return seq 42 | if isinstance(seq, numpy.ndarray) and seq.dtype.kind in 'iu': 43 | seq = [int(s) for s in seq] 44 | if len(seq) != 3: 45 | raise ValueError('Expected three ints, a 3-sequence of ints, or a Vector3j') 46 | 47 | p = vector_pb2.Vector3j() 48 | p.x = seq[0] 49 | p.y = seq[1] 50 | p.z = seq[2] 51 | return p 52 | 53 | 54 | def To3Tuple(vector): 55 | """Converts from Vector3j/tuple/numpy array to tuple. 56 | 57 | Args: 58 | vector: Vector3j/Vector3f proto, 3-element tuple, or 3-element numpy array. 59 | Returns: 60 | (x, y, z) tuple. 61 | Raises: 62 | ValueError: Unsupported argument type. 63 | """ 64 | if isinstance(vector, (vector_pb2.Vector3j, vector_pb2.Vector3f)): 65 | return (vector.x, vector.y, vector.z) 66 | if isinstance(vector, numpy.ndarray): 67 | if vector.shape != (3,): 68 | raise ValueError('Expected a Vector3j or 3-element sequence/numpy array') 69 | else: 70 | if len(vector) != 3: 71 | raise ValueError('Expected a Vector3j or 3-element sequence/numpy array') 72 | if (vector[0] != int(vector[0]) or 73 | vector[1] != int(vector[1]) or 74 | vector[2] != int(vector[2])): 75 | raise ValueError('All elements must be integers') 76 | return (int(vector[0]), int(vector[1]), int(vector[2])) 77 | 78 | 79 | def ToNumpy3Vector(vector, dtype=None): 80 | """Converts from Vector3j or 3-element sequence to numpy array.""" 81 | return numpy.array(To3Tuple(vector), dtype=dtype) 82 | -------------------------------------------------------------------------------- /plugins/Filter2D3D/Filter2D3D.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | import sys, os 5 | 6 | from PyQt5.QtWidgets import QWidget, QTabWidget, QSizePolicy, \ 7 | QDialog, QDialogButtonBox, QFormLayout, QGridLayout, QMessageBox, QSpinBox, \ 8 | QGroupBox, QHBoxLayout, QLabel, QMenu, QMenuBar, QPushButton, QFileDialog, QTextEdit, QVBoxLayout, QWidget 9 | 10 | from PyQt5.QtGui import QIcon 11 | from os import path, pardir 12 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 13 | sys.path.append(main_dir) 14 | icon_dir = path.join(main_dir, "icons") 15 | ## 16 | import miscellaneous.Miscellaneous as m 17 | from miscellaneous.SyncListQComboBoxManager import * 18 | ## 19 | 20 | plugins_dir = path.join(main_dir, "plugins") 21 | sys.path.append(plugins_dir) 22 | from plugins.miscellaneous.MiscellaneousFilters import MiscellaneousFilters 23 | from plugins.miscellaneous.ThumbnailGenerator import ThumbnailGenerator 24 | from plugins.miscellaneous.FilterlistGenerator import FilterlistGenerator 25 | from plugins.miscellaneous.TableGenerator import TableGenerator 26 | 27 | 28 | class GenerateDialog(QWidget, MiscellaneousFilters): 29 | def __init__(self, parent): 30 | self.left = 200 31 | self.top = 200 32 | self.width = 900 33 | self.height = 250 34 | self.comboText = None 35 | self.u_info = parent.u_info 36 | self.parent = parent 37 | self.title = "2D/3D Filters" 38 | super().__init__() 39 | self.initUI() 40 | 41 | def initUI(self): 42 | ### 43 | ### bottom 44 | ### 45 | 46 | table1 = TableGenerator(self) 47 | widget_bottom, obj_args, args = table1.GenerateTableObject() # Widget 48 | 49 | ### 50 | ### Top 51 | ### 52 | 53 | thumb1 = ThumbnailGenerator(self) 54 | widget_top_right = thumb1.GenerateThumbnailObject(obj_args, args) # Widget 55 | 56 | self.filter_list = FilterlistGenerator(self) 57 | widget_top_left = self.filter_list.GenerateFilterlistObject() # Widget 58 | 59 | 60 | self.targ_image_folder_qcombo.activated.connect( self.ChangeZ ) 61 | 62 | widget_top = QWidget() 63 | widget_top.layout = QHBoxLayout(widget_top) 64 | widget_top.layout.addWidget(widget_top_left) 65 | widget_top.layout.addWidget(widget_top_right) 66 | 67 | ### 68 | ### Connect bottom top 69 | ### 70 | widget_all = QWidget() 71 | widget_all.layout = QVBoxLayout(widget_all) 72 | widget_all.layout.addWidget(widget_top) 73 | widget_all.layout.addWidget(widget_bottom) 74 | self.setLayout(widget_all.layout) 75 | 76 | ## 77 | ## Generate tabs 78 | ## 79 | 80 | self.setGeometry(self.left, self.top, self.width, self.height) 81 | self.setWindowTitle(self.title) 82 | self.setWindowIcon(QIcon(path.join(icon_dir, 'Mojo2_16.png'))) 83 | self.show() 84 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/vendors/es5-shim/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "es5-shim", 3 | "version": "4.5.12", 4 | "description": "ECMAScript 5 compatibility shims for legacy JavaScript engines", 5 | "homepage": "http://github.com/es-shims/es5-shim/", 6 | "contributors": [ 7 | "Kris Kowal (http://github.com/kriskowal/)", 8 | "Sami Samhuri (http://samhuri.net/)", 9 | "Florian Schäfer (http://github.com/fschaefer)", 10 | "Irakli Gozalishvili (http://jeditoolkit.com)", 11 | "Kit Cambridge (http://kitcambridge.github.com)", 12 | "Jordan Harband (https://github.com/ljharb/)" 13 | ], 14 | "bugs": { 15 | "mail": "ljharb@gmail.com", 16 | "url": "http://github.com/es-shims/es5-shim/issues" 17 | }, 18 | "license": "MIT", 19 | "main": "es5-shim.js", 20 | "repository": { 21 | "type": "git", 22 | "url": "http://github.com/es-shims/es5-shim.git" 23 | }, 24 | "scripts": { 25 | "prepublish": "npm run minify", 26 | "minify": "npm run --silent minify-shim && npm run --silent minify-sham", 27 | "minify-shim": "uglifyjs es5-shim.js --support-ie8 --keep-fnames --comments --source-map=es5-shim.map -m -b ascii_only=true,beautify=false | sed 's/0xde0b6b3a7640080/1000000000000000128/' > es5-shim.min.js", 28 | "minify-sham": "uglifyjs es5-sham.js --support-ie8 --keep-fnames --comments --source-map=es5-sham.map -m -b ascii_only=true,beautify=false > es5-sham.min.js", 29 | "pretest": "npm run --silent lint", 30 | "test": "npm run --silent tests-only", 31 | "tests-only": "jasmine-node --matchall ./ tests/spec/", 32 | "test-native": "jasmine-node --matchall tests/spec/", 33 | "lint": "npm run --silent jscs && npm run --silent eslint", 34 | "eslint": "eslint tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js", 35 | "jscs": "jscs tests/helpers/*.js tests/spec/*.js es5-shim.js es5-sham.js" 36 | }, 37 | "devDependencies": { 38 | "@ljharb/eslint-config": "^13.0.0", 39 | "eslint": "^5.5.0", 40 | "jasmine-node": "^1.13.1", 41 | "jscs": "^3.0.7", 42 | "replace": "^1.0.0", 43 | "semver": "^5.5.1", 44 | "uglify-js": "2.7.3" 45 | }, 46 | "engines": { 47 | "node": ">=0.4.0" 48 | }, 49 | "testling": { 50 | "browsers": [ 51 | "iexplore/6.0..latest", 52 | "firefox/3.0..6.0", 53 | "firefox/18.0..latest", 54 | "firefox/nightly", 55 | "chrome/4.0..10.0", 56 | "chrome/25.0..latest", 57 | "chrome/canary", 58 | "opera/10.0..latest", 59 | "opera/next", 60 | "safari/4.0..latest", 61 | "ipad/6.0..latest", 62 | "iphone/6.0..latest", 63 | "android-browser/4.2" 64 | ] 65 | }, 66 | "keywords": [ 67 | "shim", 68 | "es5", 69 | "es5 shim", 70 | "javascript", 71 | "ecmascript", 72 | "polyfill" 73 | ], 74 | "greenkeeper": { 75 | "ignore": [ 76 | "uglify-js" 77 | ] 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /_web_dojo/gui/js/src/util.js: -------------------------------------------------------------------------------- 1 | // 汎用ユーティリティなど 2 | 3 | import * as config from './config'; 4 | 5 | /** 6 | * keydownイベントを発火する 7 | * 8 | * @param {number} keyCode 発火するキーコード 9 | */ 10 | export function triggerKeydown(keyCode) { 11 | const event = $.Event('keydown'); 12 | event.keyCode = keyCode; 13 | $(window).trigger(event); 14 | } 15 | 16 | /** 17 | * メソッドが呼ばれた後に任意の処理を追加する 18 | * 19 | * @param {Object} target 対象のオブジェクト 20 | * @param {string} name 対象のメソッド名 21 | * @param {Function} before 後に追加する処理 22 | * オリジナルの引数が全て渡されて呼び出される 23 | * @return 元のメソッドの戻り値が返る 24 | */ 25 | export function addAfter(target, name, after) { 26 | const original = target[name]; 27 | target[name] = function() { 28 | const result = original.apply(this, arguments); 29 | after.apply(this, arguments); 30 | return result; 31 | }; 32 | } 33 | 34 | /** 35 | * windowの中央位置を取得する 36 | * 37 | * @return {Object} 位置が定義されたオブジェクト 38 | * - x : 画面の横軸中央 39 | * - y : 画面の縦軸中央 40 | */ 41 | export function getWindowCenterPos() { 42 | const x = Math.floor($(window).width() / 2); 43 | const y = Math.floor($(window).height() / 2); 44 | 45 | return { 46 | x: x, 47 | y: y 48 | }; 49 | } 50 | 51 | /** 52 | * dojoのcamera(メインのcanvas)の中央位置を取得する 53 | * 54 | * 参考: 55 | * _web/camera.js 56 | * J.camera.prototype.center 57 | * 58 | * @return {Object} 位置が定義されたオブジェクト 59 | * - x : 画面の横軸中央 60 | * - y : 画面の縦軸中央 61 | * - left : cameraの左位置 62 | * - right : cameraの右位置 63 | * - top : cameraの上位置 64 | * - bottom : cameraの下位置 65 | */ 66 | export function getCameraCenterPos() { 67 | const centerX = DOJO.viewer._width / 2; 68 | const centerY = DOJO.viewer._height / 2; 69 | 70 | const canvasLeft = centerX - config.DOJO_CANVAS_BUFFER_WIDTH / 2; 71 | const canvasRight = canvasLeft + config.DOJO_CANVAS_BUFFER_WIDTH; 72 | const canvasTop = centerY - config.DOJO_CANVAS_BUFFER_HEIGHT / 2; 73 | const canvasBottom = canvasTop + config.DOJO_CANVAS_BUFFER_HEIGHT; 74 | 75 | return { 76 | x: centerX, 77 | y: centerY, 78 | left: canvasLeft, 79 | right: canvasRight, 80 | top: canvasTop, 81 | bottom: canvasBottom 82 | }; 83 | } 84 | 85 | /** 86 | * 指定の座標がcanvasのイメージ上にあるかどうか 87 | * 88 | * @param {number} x x座標 89 | * @param {number} y y座標 90 | * @return {Boolean} 91 | */ 92 | export function isOverImage(x, y) { 93 | const u_v = DOJO.viewer.xy2uv(x, y); 94 | return u_v[0] !== -1 && u_v[1] !== -1; 95 | } 96 | 97 | /** 98 | * 正しくズームできるかどうか 99 | * 読み込んだ画像が正方形じゃなかった場合、余った領域は黒くなる 100 | * その黒い部分はマウスカーソルが反応しないためズームができない 101 | * 102 | * @param {number} canvasImageWidth 読み込んだイメージのwidth 103 | * @param {number} canvasImageHeight 読み込んだイメージのheight 104 | * @return {Boolean} 105 | */ 106 | export function isZoomableImage(canvasImageWidth, canvasImageHeight) { 107 | const half = canvasImageHeight / 2; 108 | return canvasImageWidth - half > 0; 109 | } 110 | 111 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/ffn/training/optimizer.py: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Google Inc. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # https://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | """Utilities to configure TF optimizers.""" 16 | 17 | from __future__ import absolute_import 18 | from __future__ import division 19 | from __future__ import print_function 20 | 21 | 22 | # import tensorflow as tf 23 | ## HU 24 | import pkg_resources 25 | ver = pkg_resources.get_distribution('tensorflow').version 26 | if ('1.15' in ver) |( '2.' in ver ): 27 | import tensorflow.compat.v1 as tf 28 | tf.disable_v2_behavior() 29 | else: 30 | import tensorflow as tf 31 | ## 32 | 33 | from absl import flags 34 | 35 | 36 | FLAGS = flags.FLAGS 37 | 38 | flags.DEFINE_string('optimizer', 'sgd', 39 | 'Which optimizer to use. Valid values are: ' 40 | 'momentum, sgd, adagrad, adam, rmsprop.') 41 | flags.DEFINE_float('learning_rate', 0.001, 'Initial learning rate.') 42 | flags.DEFINE_float('momentum', 0.9, 'Momentum.') 43 | flags.DEFINE_float('learning_rate_decay_factor', 0.94, 44 | 'Learning rate decay factor.') 45 | flags.DEFINE_float('num_epochs_per_decay', 2.0, 46 | 'Number of epochs after which learning rate decays.') 47 | flags.DEFINE_float('rmsprop_decay', 0.9, 'Decay term for RMSProp.') 48 | flags.DEFINE_float('adam_beta1', 0.9, 'Gradient decay term for Adam.') 49 | flags.DEFINE_float('adam_beta2', 0.999, 'Gradient^2 decay term for Adam.') 50 | flags.DEFINE_float('epsilon', 1e-8, 'Epsilon term for RMSProp and Adam.') 51 | 52 | 53 | def optimizer_from_flags(): 54 | lr = FLAGS.learning_rate 55 | if FLAGS.optimizer == 'momentum': 56 | return tf.train.MomentumOptimizer(lr, FLAGS.momentum) 57 | elif FLAGS.optimizer == 'sgd': 58 | return tf.train.GradientDescentOptimizer(lr) 59 | elif FLAGS.optimizer == 'adagrad': 60 | return tf.train.AdagradOptimizer(lr) 61 | elif FLAGS.optimizer == 'adam': 62 | return tf.train.AdamOptimizer(learning_rate=lr, 63 | beta1=FLAGS.adam_beta1, 64 | beta2=FLAGS.adam_beta2, 65 | epsilon=FLAGS.epsilon) 66 | elif FLAGS.optimizer == 'rmsprop': 67 | return tf.train.RMSPropOptimizer(lr, FLAGS.rmsprop_decay, 68 | momentum=FLAGS.momentum, 69 | epsilon=FLAGS.epsilon) 70 | else: 71 | raise ValueError('Unknown optimizer: %s' % FLAGS.optimizer) 72 | -------------------------------------------------------------------------------- /segment/_3D_FFN/ffn/ffn_inference_demo.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": { 7 | "collapsed": true 8 | }, 9 | "outputs": [], 10 | "source": [ 11 | "from google.protobuf import text_format\n", 12 | "from ffn.inference import inference\n", 13 | "from ffn.inference import inference_pb2" 14 | ] 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": null, 19 | "metadata": { 20 | "collapsed": true 21 | }, 22 | "outputs": [], 23 | "source": [ 24 | "config = '''image {\n", 25 | " hdf5: \"third_party/neuroproof_examples/training_sample2/grayscale_maps.h5:raw\"\n", 26 | "}\n", 27 | "image_mean: 128\n", 28 | "image_stddev: 33\n", 29 | "checkpoint_interval: 1800\n", 30 | "seed_policy: \"PolicyPeaks\"\n", 31 | "model_checkpoint_path: \"models/fib25/model.ckpt-27465036\"\n", 32 | "model_name: \"convstack_3d.ConvStack3DFFNModel\"\n", 33 | "model_args: \"{\\\\\"depth\\\\\": 12, \\\\\"fov_size\\\\\": [33, 33, 33], \\\\\"deltas\\\\\": [8, 8, 8]}\"\n", 34 | "segmentation_output_dir: \"results/fib25/training2\"\n", 35 | "inference_options {\n", 36 | " init_activation: 0.95\n", 37 | " pad_value: 0.05\n", 38 | " move_threshold: 0.9\n", 39 | " min_boundary_dist { x: 1 y: 1 z: 1}\n", 40 | " segment_threshold: 0.6\n", 41 | " min_segment_size: 1000\n", 42 | "}'''\n", 43 | "req = inference_pb2.InferenceRequest()\n", 44 | "_ = text_format.Parse(config, req)" 45 | ] 46 | }, 47 | { 48 | "cell_type": "code", 49 | "execution_count": null, 50 | "metadata": {}, 51 | "outputs": [], 52 | "source": [ 53 | "runner = inference.Runner()\n", 54 | "runner.start(req)\n", 55 | "canvas, alignment = runner.make_canvas((0, 0, 0), (250, 250, 250))" 56 | ] 57 | }, 58 | { 59 | "cell_type": "code", 60 | "execution_count": null, 61 | "metadata": {}, 62 | "outputs": [], 63 | "source": [ 64 | "# Create a single segment, starting from the specified origin point.\n", 65 | "canvas.segment_at((125, 125, 125), # zyx\n", 66 | " dynamic_image=inference.DynamicImage(),\n", 67 | " vis_update_every=1)" 68 | ] 69 | }, 70 | { 71 | "cell_type": "code", 72 | "execution_count": null, 73 | "metadata": { 74 | "collapsed": true 75 | }, 76 | "outputs": [], 77 | "source": [] 78 | } 79 | ], 80 | "metadata": { 81 | "kernelspec": { 82 | "display_name": "Python 3", 83 | "language": "python", 84 | "name": "python3" 85 | }, 86 | "language_info": { 87 | "codemirror_mode": { 88 | "name": "ipython", 89 | "version": 3 90 | }, 91 | "file_extension": ".py", 92 | "mimetype": "text/x-python", 93 | "name": "python", 94 | "nbconvert_exporter": "python", 95 | "pygments_lexer": "ipython3", 96 | "version": "3.6.1" 97 | } 98 | }, 99 | "nbformat": 4, 100 | "nbformat_minor": 2 101 | } 102 | -------------------------------------------------------------------------------- /annotator/Annotator/ControlAnnotatorServer.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | 5 | 6 | import sys, os, time, errno 7 | import threading 8 | import sqlite3 9 | import json 10 | # from marching_cubes import march 11 | # from stl import mesh 12 | from os import path, pardir 13 | 14 | ## 15 | 16 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 17 | sys.path.append(path.join(main_dir, "annotator")) 18 | sys.path.append(os.path.join(main_dir, "system")) 19 | sys.path.append(os.path.join(main_dir, "dojoio")) 20 | 21 | from Annotator.AnnotatorServer import AnnotatorServerLogic 22 | from DB import DB 23 | from Params import Params 24 | import miscellaneous.Miscellaneous as m 25 | ## 26 | ### 27 | ### 28 | class ControlAnnotatorServer: 29 | 30 | ### 31 | def __init__(self, u_info): 32 | 33 | ## User info 34 | self.u_info = u_info 35 | 36 | ## Makedir 37 | if os.path.isdir(self.u_info.data_annotator_path) == False: 38 | os.makedirs(self.u_info.data_annotator_path) 39 | 40 | ## Load color file 41 | colordata = m.load_hdf5(self.u_info.color_map_file, self.u_info.hdf_color_name) 42 | colnum = colordata.shape[0]; 43 | 44 | 45 | ## Load database file 46 | query = "select * from segmentInfo;" 47 | con = sqlite3.connect( self.u_info.segment_info_db_file ) 48 | cur = con.cursor() 49 | cur.execute( query ) # Obtain max id 50 | #data = cur.fetchone() 51 | data = cur.fetchall() 52 | con.close() 53 | 54 | keys = ['id', 'name', 'size', 'confidence'] 55 | data_dict = [dict(zip(keys, valuerecord)) for valuerecord in data] 56 | 57 | 58 | for i, datum_dict in enumerate(data_dict): 59 | id = datum_dict['id'] 60 | if id >= colnum: 61 | col = {'r': 128, 'g': 128, 'b': 128, 'act': 0} 62 | else: 63 | col = {'r': int(colordata[id][0]), 'g': int(colordata[id][1]), 'b': int(colordata[id][2]), 'act': 0} 64 | data_dict[i].update(col) 65 | 66 | ## 67 | ## Save 68 | ## 69 | with open(os.path.join(self.u_info.data_annotator_path,"segmentInfo.json"), 'w') as f: 70 | json.dump(data_dict, f, indent=2, ensure_ascii=False) 71 | 72 | 73 | def StartThreadAnnotatorServer(self): 74 | logic = AnnotatorServerLogic(self.u_info) 75 | logic.run() 76 | 77 | def LaunchAnnotator(self): 78 | # self.u_info.worker_loop_stl = asyncio.new_event_loop() 79 | self.u_info.stl_thread = threading.Thread(target=self.StartThreadAnnotatorServer) 80 | self.u_info.stl_thread.setDaemon(True) # Stops if control-C 81 | self.u_info.stl_thread.start() 82 | 83 | def TerminateAnnotator(self): 84 | print('TerminateAnnotator') 85 | if self.u_info.stl_thread == None: 86 | print("3D Annotator is not open\n") 87 | return False 88 | 89 | print("Asked tornado to exit\n") 90 | #self.u_info.worker_loop_stl.stop() 91 | #time.sleep(1) 92 | #self.u_info.worker_loop_stl.close() 93 | self.u_info.stl_thread = None 94 | -------------------------------------------------------------------------------- /dojoio/SaveChanges.py: -------------------------------------------------------------------------------- 1 | ### 2 | ### 3 | ### 4 | 5 | import os 6 | import sys 7 | import itertools 8 | import math 9 | import numpy as np 10 | import shutil 11 | 12 | from time import sleep 13 | from os import path, pardir 14 | main_dir = path.abspath(path.dirname(sys.argv[0])) # Dir of main 15 | sys.path.append(os.path.join(main_dir, "dojo")) 16 | sys.path.append(os.path.join(main_dir, "dojoio")) 17 | from DB import DB 18 | from Params import Params 19 | import miscellaneous.Miscellaneous as m 20 | import DojoServer 21 | 22 | 23 | class SaveChanges: 24 | 25 | ### 26 | def __init__(self): 27 | return 28 | ### 29 | def lookup_label(self, label_id, merge_table): 30 | 31 | while str(label_id) in merge_table.keys(): 32 | label_id = merge_table[str(label_id)] 33 | return label_id 34 | 35 | ### 36 | 37 | def StartThreadDojo(self): 38 | logic = DojoStandalone.ServerLogic() 39 | logic.run(self.u_info) 40 | 41 | ### 42 | ### 43 | def run(self, u_info): 44 | 45 | ## Load DB 46 | db = DB(u_info) 47 | self.u_info = u_info 48 | ## 49 | ## Update split and adjust 50 | ## 51 | 52 | for iz in range(db.num_tiles_z): 53 | 54 | print('Saving: ', iz, '/', db.num_tiles_z) 55 | # Check teemporary data 56 | data_path = u_info.tmp_tile_ids_path + u_info.tile_path_wz.format(0, iz) 57 | if not os.path.isdir(data_path): 58 | continue 59 | 60 | # print('Copy from ', data_path) 61 | for iw in range(db.num_tiles_w): 62 | source_dir = u_info.tmp_tile_ids_path \ 63 | + u_info.tile_path_wz.format(iw, iz) 64 | destination_dir = u_info.tile_ids_path \ 65 | + u_info.tile_path_wz.format(iw, iz) 66 | shutil.rmtree(destination_dir) 67 | shutil.move(source_dir, destination_dir) 68 | 69 | ## Remove temp file 70 | # shutil.rmtree(source_dir) 71 | 72 | ## 73 | ## Update merges 74 | ## 75 | 76 | # print(u_info.merge_table) 77 | 78 | for iw in range(db.num_tiles_w): 79 | for iz, iy, ix in itertools.product(range(db.num_tiles_z), range(db.num_tiles_y_at_w[iw]), range(db.num_tiles_x_at_w[iw])): 80 | 81 | ### Load tile file 82 | tile_ids_filename = u_info.tile_ids_path + u_info.tile_ids_filename_wzyx.format( iw, iz, iy, ix ) 83 | tile_ids = m.load_hdf5( tile_ids_filename, u_info.tile_var_name ) 84 | 85 | ## Color exchange [for merge? check __merge_table.keys() ] 86 | for mm in u_info.merge_table.keys(): 87 | mm_id = self.lookup_label(mm, u_info.merge_table) 88 | tile_ids[ tile_ids == int(mm) ] = mm_id 89 | 90 | ### Save tile file 91 | m.save_hdf5(tile_ids_filename, u_info.tile_var_name, tile_ids) 92 | 93 | u_info.merge_table = {} 94 | u_info.flag_undo = 0 95 | u_info.flag_redo = 0 96 | 97 | ## Update 98 | print('Updating database.') 99 | db.Update() 100 | print('Successfully saved.') 101 | 102 | 103 | --------------------------------------------------------------------------------