├── ci ├── recipe_clobber_linux.yaml ├── recipe_clobber_osx.yaml └── deploy_anaconda.py ├── docs ├── _static │ ├── .gitignore │ ├── straditize.ico │ ├── straditize.png │ └── straditizer-control.png ├── changelog.rst ├── tutorial │ ├── tutorial-button.png │ ├── thumb │ │ ├── beginner-tutorial-thumb.png │ │ └── hoya-del-castillo-thumb.png │ └── index.rst ├── requirements.txt ├── apigen.bash ├── environment.yml ├── straditize_entry.bib ├── command_line.rst ├── straditize_entry.enw └── about.rst ├── tests ├── test_figures │ ├── data │ │ ├── column_bounds.dat │ │ ├── bar_data.csv │ │ ├── data.csv │ │ ├── bar_locations.dat │ │ └── full_data.csv │ ├── bar_diagram.png │ ├── basic_diagram.png │ ├── colnames_diagram.png │ ├── stacked_diagram.png │ ├── basic_diagram_black.png │ ├── basic_diagram_xaxes.png │ ├── basic_diagram_yaxes.png │ ├── basic_diagram_binary.png │ ├── basic_diagram_hlines.png │ ├── basic_diagram_select.png │ ├── basic_diagram_vlines.png │ ├── basic_diagram_cross_col.png │ ├── basic_diagram_noborders.png │ ├── basic_diagram_occurences.png │ ├── colnames_diagram-Pinus.png │ ├── basic_diagram_exaggerated.png │ ├── colnames_diagram-colnames.png │ ├── basic_diagram_disconnected_01.png │ ├── basic_diagram_disconnected_02.png │ ├── basic_diagram_disconnected_03.png │ ├── basic_diagram_hlines_removed.png │ ├── basic_diagram_select_pattern.png │ ├── basic_diagram_select_removed.png │ ├── basic_diagram_small_features.png │ ├── basic_diagram_vlines_removed.png │ ├── basic_diagram_xaxes_removed.png │ ├── basic_diagram_yaxes_removed.png │ ├── basic_diagram_cross_col_removed.png │ ├── basic_diagram_disconnected_01_ref.png │ ├── basic_diagram_disconnected_02_ref.png │ ├── basic_diagram_disconnected_03_ref.png │ ├── basic_diagram_features_at_col_ends.png │ ├── basic_diagram_select_pattern_removed.png │ ├── basic_diagram_select_removed_binary.png │ ├── basic_diagram_select_pattern_removed_20px.png │ └── basic_diagram_features_at_col_ends_removed.png ├── widgets │ ├── test_command_line.py │ ├── test_image_correction.py │ ├── test_straditizer_widgets.py │ └── test_plots.py ├── test_straditizer.py └── conftest.py ├── icon ├── main.icns ├── icon1024.png ├── straditize.ico ├── CreateICO.sh ├── CreateICNS.sh └── icon.py ├── conda-recipe ├── logo.png ├── straditize.ico ├── menu-windows.json └── meta.yaml ├── paper ├── hoya-del-castillo.png ├── paper.md └── paper.bib ├── straditize ├── widgets │ ├── docs │ │ ├── valid.png │ │ ├── columns.png │ │ ├── drag_mark.png │ │ ├── invalid.png │ │ ├── run_arrow.png │ │ ├── bar-diagram.png │ │ ├── drag_mark2.png │ │ ├── load-image.png │ │ ├── occurences.png │ │ ├── select-x0_1.png │ │ ├── select-x0_2.png │ │ ├── select-x0_3.png │ │ ├── select-x1_1.png │ │ ├── select-x1_2.png │ │ ├── select-x1_3.png │ │ ├── select-y0_1.png │ │ ├── select-y0_2.png │ │ ├── select-y0_3.png │ │ ├── select-y1_1.png │ │ ├── select-y1_2.png │ │ ├── select-y1_3.png │ │ ├── select_mark.png │ │ ├── align_column1.png │ │ ├── align_column2.png │ │ ├── area-diagram.png │ │ ├── child-readers.png │ │ ├── columns-widget.png │ │ ├── corrected-mark.png │ │ ├── displaced-mark.png │ │ ├── export-final.png │ │ ├── line-diagram.png │ │ ├── marker-control.png │ │ ├── plot-control.png │ │ ├── sample_diagram.png │ │ ├── samples-editor.png │ │ ├── save-project.png │ │ ├── align_column1-2.png │ │ ├── align_column2-2.png │ │ ├── colnames-editor.png │ │ ├── edit-occurences.png │ │ ├── stacked-diagram.png │ │ ├── stacked-diagram0.png │ │ ├── stacked-diagram1.png │ │ ├── stacked-diagram2.png │ │ ├── stacked-diagram3.png │ │ ├── stacked-diagram4.png │ │ ├── stacked-diagram5.png │ │ ├── basic_diagram_xaxes.png │ │ ├── basic_diagram_yaxes.png │ │ ├── digitize-vs-sample.png │ │ ├── edit-samples-marks.png │ │ ├── edited-occurences.png │ │ ├── full-columns-widget.png │ │ ├── full-digitized-data.png │ │ ├── removed-occurences.png │ │ ├── rounded-bar-diagram.png │ │ ├── selected-occurences.png │ │ ├── straditizer-layout.png │ │ ├── bar-diagram-splitting.png │ │ ├── basic_diagram_hlines.png │ │ ├── basic_diagram_vlines.png │ │ ├── colnames-editor-col0.png │ │ ├── sample_diagram-header.png │ │ ├── bar-diagram-digitization.png │ │ ├── bar-diagram-splitting2.png │ │ ├── basic_diagram_cross_col.png │ │ ├── colnames-editor-colpic.png │ │ ├── basic_diagram_disconnected.png │ │ ├── basic_diagram_exaggerated.png │ │ ├── colnames-editor-colpic-HR.png │ │ ├── basic_diagram_disconnected_01.png │ │ ├── basic_diagram_disconnected_02.png │ │ ├── basic_diagram_disconnected_03.png │ │ ├── basic_diagram_small_features.png │ │ ├── colnames-editor-highlighted.png │ │ ├── stacked-digitization-control.png │ │ ├── basic_diagram_features_at_col_ends.png │ │ ├── colnames-editor-colpic-recognized.png │ │ ├── sample_diagram_digitize-explanation.png │ │ ├── remove_col_ends.rst │ │ ├── tools.rst │ │ ├── axes_translations.rst │ │ ├── remove_cross_column.rst │ │ ├── samples.rst │ │ ├── straditize.rst │ │ ├── remove_small_parts.rst │ │ ├── load_samples.rst │ │ ├── straditize_steps.rst │ │ ├── find_samples.rst │ │ ├── export.rst │ │ ├── select_column_ends.rst │ │ ├── align_columns.rst │ │ ├── child_readers.rst │ │ ├── select_data_part.rst │ │ ├── load_image.rst │ │ ├── select_column_starts.rst │ │ ├── remove_lines.rst │ │ ├── remove_disconnected_parts.rst │ │ ├── yaxis_translation.rst │ │ ├── select_reader.rst │ │ ├── occurences.rst │ │ ├── xaxis_translation.rst │ │ ├── save_and_load.rst │ │ ├── exaggerations.rst │ │ ├── plot_control.rst │ │ ├── marker_control.rst │ │ ├── edit_samples.rst │ │ ├── terminology.rst │ │ ├── removing_features.rst │ │ └── column_names.rst │ ├── icons │ │ ├── next_bar.png │ │ ├── pattern.png │ │ ├── prev_bar.png │ │ ├── select.png │ │ ├── add_select.png │ │ ├── col_select.png │ │ ├── left_mark.png │ │ ├── lower_mark.png │ │ ├── right_mark.png │ │ ├── row_select.png │ │ ├── select_all.png │ │ ├── straditize.png │ │ ├── upper_mark.png │ │ ├── clear_select.png │ │ ├── color_select.png │ │ ├── expand_select.png │ │ ├── invert_select.png │ │ ├── new_selection.png │ │ ├── pattern_grey.png │ │ ├── poly_select.png │ │ ├── remove_select.png │ │ ├── select_right.png │ │ ├── wand_select.png │ │ └── intersect_select.png │ ├── tutorial │ │ ├── beginner │ │ │ ├── xaxes.png │ │ │ ├── yaxes.png │ │ │ ├── data-part.png │ │ │ ├── move_large.png │ │ │ ├── right-line.png │ │ │ ├── column-starts.png │ │ │ ├── control-arrow.png │ │ │ ├── select-right.png │ │ │ ├── beginner-tutorial.png │ │ │ ├── zoom_to_rect_large.png │ │ │ ├── column-selection-tool.png │ │ │ ├── straditizer-control.png │ │ │ ├── straditizer-control-cut.png │ │ │ ├── tutorial-colnames-editor.png │ │ │ ├── matplotlib-navigation-toolbar.png │ │ │ ├── tutorial-colnames-editor-finished.png │ │ │ ├── beginner-tutorial-load-image.rst │ │ │ ├── beginner-tutorial-create-reader.rst │ │ │ ├── beginner-tutorial-digitize.rst │ │ │ ├── beginner-tutorial-finish.rst │ │ │ ├── beginner-tutorial-xaxis-translation.rst │ │ │ ├── beginner-tutorial-column-starts.rst │ │ │ ├── beginner-tutorial-samples.rst │ │ │ ├── beginner-tutorial-yaxis-translation.rst │ │ │ ├── beginner-tutorial-column-names.rst │ │ │ ├── beginner-tutorial-clean-image.rst │ │ │ ├── beginner-tutorial-select-data.rst │ │ │ ├── beginner-tutorial-control.rst │ │ │ ├── beginner-tutorial-intro.rst │ │ │ └── beginner-tutorial-plot-navigation.rst │ │ ├── hoya-del-castillo │ │ │ ├── select-x0-col0.png │ │ │ ├── charcoal-column.png │ │ │ ├── hoya-del-castillo.png │ │ │ ├── select-data-lr1.png │ │ │ ├── select-data-ul0.png │ │ │ ├── select-data-ul1.png │ │ │ ├── select-x0-col1-26.png │ │ │ ├── select-x0-col27.png │ │ │ ├── pollen-taxa-columns.png │ │ │ ├── colnames-editor-zoomed.png │ │ │ ├── hoya-del-castillo-colnames.png │ │ │ ├── pollen-concentration-column.png │ │ │ ├── hoya-del-castillo-tutorial-load-image.rst │ │ │ ├── hoya-del-castillo-tutorial-create-reader.rst │ │ │ ├── hoya-del-castillo-tutorial-digitize.rst │ │ │ ├── hoya-del-castillo-tutorial-finish.rst │ │ │ ├── hoya-del-castillo-tutorial-column-starts.rst │ │ │ ├── hoya-del-castillo-tutorial-select-data.rst │ │ │ ├── hoya-del-castillo-tutorial-column-names.rst │ │ │ ├── hoya-del-castillo-tutorial-samples.rst │ │ │ ├── hoya-del-castillo-tutorial-meta.rst │ │ │ ├── hoya-del-castillo-tutorial-yaxis-translation.rst │ │ │ ├── hoya-del-castillo-tutorial-remove-lines.rst │ │ │ ├── hoya-del-castillo-tutorial-intro.rst │ │ │ ├── hoya-del-castillo-tutorial-column-names-ocr.rst │ │ │ └── hoya-del-castillo-tutorial-xaxis-translation.rst │ │ └── __init__.py │ └── axes_translations.py ├── version.py ├── common.py └── __init__.py ├── readthedocs.yml ├── MANIFEST.in ├── .github ├── pull_request_template.md ├── ISSUE_TEMPLATE │ ├── new_feature.md │ └── change_feature.md └── issue_template.md ├── CHANGELOG.rst ├── appveyor.yml ├── .gitignore ├── .circleci └── config.yml ├── setup.py ├── CODE_OF_CONDUCT.md ├── README.rst └── .travis.yml /ci/recipe_clobber_linux.yaml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/_static/.gitignore: -------------------------------------------------------------------------------- 1 | docs_*.png 2 | -------------------------------------------------------------------------------- /tests/test_figures/data/column_bounds.dat: -------------------------------------------------------------------------------- 1 | 0 4 2 | 6 12 3 | 14 18 4 | -------------------------------------------------------------------------------- /icon/main.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/icon/main.icns -------------------------------------------------------------------------------- /icon/icon1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/icon/icon1024.png -------------------------------------------------------------------------------- /icon/straditize.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/icon/straditize.ico -------------------------------------------------------------------------------- /conda-recipe/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/conda-recipe/logo.png -------------------------------------------------------------------------------- /icon/CreateICO.sh: -------------------------------------------------------------------------------- 1 | convert icon1024.png -define icon:auto-resize=64,48,32,16 straditize.ico 2 | -------------------------------------------------------------------------------- /tests/test_figures/data/bar_data.csv: -------------------------------------------------------------------------------- 1 | height,0,1,2 2 | 1,2,3,2 3 | 9,2,2,3 4 | 12,2,4,1 5 | 18,4,2,1 6 | -------------------------------------------------------------------------------- /tests/test_figures/data/data.csv: -------------------------------------------------------------------------------- 1 | height,0,1,2 2 | 0,2,3,2 3 | 8,2,2,3 4 | 11,2,4,1 5 | 19,4,2,1 6 | -------------------------------------------------------------------------------- /conda-recipe/straditize.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/conda-recipe/straditize.ico -------------------------------------------------------------------------------- /docs/_static/straditize.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/docs/_static/straditize.ico -------------------------------------------------------------------------------- /docs/_static/straditize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/docs/_static/straditize.png -------------------------------------------------------------------------------- /paper/hoya-del-castillo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/paper/hoya-del-castillo.png -------------------------------------------------------------------------------- /docs/changelog.rst: -------------------------------------------------------------------------------- 1 | .. _changelog: 2 | 3 | Changelog 4 | ********* 5 | 6 | .. include:: ../CHANGELOG.rst 7 | -------------------------------------------------------------------------------- /docs/tutorial/tutorial-button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/docs/tutorial/tutorial-button.png -------------------------------------------------------------------------------- /straditize/widgets/docs/valid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/valid.png -------------------------------------------------------------------------------- /tests/test_figures/bar_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/bar_diagram.png -------------------------------------------------------------------------------- /docs/_static/straditizer-control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/docs/_static/straditizer-control.png -------------------------------------------------------------------------------- /straditize/widgets/docs/columns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/columns.png -------------------------------------------------------------------------------- /straditize/widgets/docs/drag_mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/drag_mark.png -------------------------------------------------------------------------------- /straditize/widgets/docs/invalid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/invalid.png -------------------------------------------------------------------------------- /straditize/widgets/docs/run_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/run_arrow.png -------------------------------------------------------------------------------- /straditize/widgets/icons/next_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/next_bar.png -------------------------------------------------------------------------------- /straditize/widgets/icons/pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/pattern.png -------------------------------------------------------------------------------- /straditize/widgets/icons/prev_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/prev_bar.png -------------------------------------------------------------------------------- /straditize/widgets/icons/select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/select.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram.png -------------------------------------------------------------------------------- /straditize/widgets/docs/bar-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/bar-diagram.png -------------------------------------------------------------------------------- /straditize/widgets/docs/drag_mark2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/drag_mark2.png -------------------------------------------------------------------------------- /straditize/widgets/docs/load-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/load-image.png -------------------------------------------------------------------------------- /straditize/widgets/docs/occurences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/occurences.png -------------------------------------------------------------------------------- /straditize/widgets/docs/select-x0_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/select-x0_1.png -------------------------------------------------------------------------------- /straditize/widgets/docs/select-x0_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/select-x0_2.png -------------------------------------------------------------------------------- /straditize/widgets/docs/select-x0_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/select-x0_3.png -------------------------------------------------------------------------------- /straditize/widgets/docs/select-x1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/select-x1_1.png -------------------------------------------------------------------------------- /straditize/widgets/docs/select-x1_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/select-x1_2.png -------------------------------------------------------------------------------- /straditize/widgets/docs/select-x1_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/select-x1_3.png -------------------------------------------------------------------------------- /straditize/widgets/docs/select-y0_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/select-y0_1.png -------------------------------------------------------------------------------- /straditize/widgets/docs/select-y0_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/select-y0_2.png -------------------------------------------------------------------------------- /straditize/widgets/docs/select-y0_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/select-y0_3.png -------------------------------------------------------------------------------- /straditize/widgets/docs/select-y1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/select-y1_1.png -------------------------------------------------------------------------------- /straditize/widgets/docs/select-y1_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/select-y1_2.png -------------------------------------------------------------------------------- /straditize/widgets/docs/select-y1_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/select-y1_3.png -------------------------------------------------------------------------------- /straditize/widgets/docs/select_mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/select_mark.png -------------------------------------------------------------------------------- /straditize/widgets/icons/add_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/add_select.png -------------------------------------------------------------------------------- /straditize/widgets/icons/col_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/col_select.png -------------------------------------------------------------------------------- /straditize/widgets/icons/left_mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/left_mark.png -------------------------------------------------------------------------------- /straditize/widgets/icons/lower_mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/lower_mark.png -------------------------------------------------------------------------------- /straditize/widgets/icons/right_mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/right_mark.png -------------------------------------------------------------------------------- /straditize/widgets/icons/row_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/row_select.png -------------------------------------------------------------------------------- /straditize/widgets/icons/select_all.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/select_all.png -------------------------------------------------------------------------------- /straditize/widgets/icons/straditize.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/straditize.png -------------------------------------------------------------------------------- /straditize/widgets/icons/upper_mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/upper_mark.png -------------------------------------------------------------------------------- /tests/test_figures/colnames_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/colnames_diagram.png -------------------------------------------------------------------------------- /tests/test_figures/stacked_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/stacked_diagram.png -------------------------------------------------------------------------------- /straditize/widgets/docs/align_column1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/align_column1.png -------------------------------------------------------------------------------- /straditize/widgets/docs/align_column2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/align_column2.png -------------------------------------------------------------------------------- /straditize/widgets/docs/area-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/area-diagram.png -------------------------------------------------------------------------------- /straditize/widgets/docs/child-readers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/child-readers.png -------------------------------------------------------------------------------- /straditize/widgets/docs/columns-widget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/columns-widget.png -------------------------------------------------------------------------------- /straditize/widgets/docs/corrected-mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/corrected-mark.png -------------------------------------------------------------------------------- /straditize/widgets/docs/displaced-mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/displaced-mark.png -------------------------------------------------------------------------------- /straditize/widgets/docs/export-final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/export-final.png -------------------------------------------------------------------------------- /straditize/widgets/docs/line-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/line-diagram.png -------------------------------------------------------------------------------- /straditize/widgets/docs/marker-control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/marker-control.png -------------------------------------------------------------------------------- /straditize/widgets/docs/plot-control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/plot-control.png -------------------------------------------------------------------------------- /straditize/widgets/docs/sample_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/sample_diagram.png -------------------------------------------------------------------------------- /straditize/widgets/docs/samples-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/samples-editor.png -------------------------------------------------------------------------------- /straditize/widgets/docs/save-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/save-project.png -------------------------------------------------------------------------------- /straditize/widgets/icons/clear_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/clear_select.png -------------------------------------------------------------------------------- /straditize/widgets/icons/color_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/color_select.png -------------------------------------------------------------------------------- /straditize/widgets/icons/expand_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/expand_select.png -------------------------------------------------------------------------------- /straditize/widgets/icons/invert_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/invert_select.png -------------------------------------------------------------------------------- /straditize/widgets/icons/new_selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/new_selection.png -------------------------------------------------------------------------------- /straditize/widgets/icons/pattern_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/pattern_grey.png -------------------------------------------------------------------------------- /straditize/widgets/icons/poly_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/poly_select.png -------------------------------------------------------------------------------- /straditize/widgets/icons/remove_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/remove_select.png -------------------------------------------------------------------------------- /straditize/widgets/icons/select_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/select_right.png -------------------------------------------------------------------------------- /straditize/widgets/icons/wand_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/wand_select.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_black.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_xaxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_xaxes.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_yaxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_yaxes.png -------------------------------------------------------------------------------- /straditize/widgets/docs/align_column1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/align_column1-2.png -------------------------------------------------------------------------------- /straditize/widgets/docs/align_column2-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/align_column2-2.png -------------------------------------------------------------------------------- /straditize/widgets/docs/colnames-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/colnames-editor.png -------------------------------------------------------------------------------- /straditize/widgets/docs/edit-occurences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/edit-occurences.png -------------------------------------------------------------------------------- /straditize/widgets/docs/stacked-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/stacked-diagram.png -------------------------------------------------------------------------------- /straditize/widgets/docs/stacked-diagram0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/stacked-diagram0.png -------------------------------------------------------------------------------- /straditize/widgets/docs/stacked-diagram1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/stacked-diagram1.png -------------------------------------------------------------------------------- /straditize/widgets/docs/stacked-diagram2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/stacked-diagram2.png -------------------------------------------------------------------------------- /straditize/widgets/docs/stacked-diagram3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/stacked-diagram3.png -------------------------------------------------------------------------------- /straditize/widgets/docs/stacked-diagram4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/stacked-diagram4.png -------------------------------------------------------------------------------- /straditize/widgets/docs/stacked-diagram5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/stacked-diagram5.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_binary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_binary.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_hlines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_hlines.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_select.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_vlines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_vlines.png -------------------------------------------------------------------------------- /docs/requirements.txt: -------------------------------------------------------------------------------- 1 | # Sphinx 2 | # https://github.com/sphinx-doc/sphinx/blob/master/CHANGES 3 | sphinx != 1.7.5 # rq.filter: >=1.3, <1.8 4 | -------------------------------------------------------------------------------- /docs/tutorial/thumb/beginner-tutorial-thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/docs/tutorial/thumb/beginner-tutorial-thumb.png -------------------------------------------------------------------------------- /docs/tutorial/thumb/hoya-del-castillo-thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/docs/tutorial/thumb/hoya-del-castillo-thumb.png -------------------------------------------------------------------------------- /straditize/widgets/docs/basic_diagram_xaxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/basic_diagram_xaxes.png -------------------------------------------------------------------------------- /straditize/widgets/docs/basic_diagram_yaxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/basic_diagram_yaxes.png -------------------------------------------------------------------------------- /straditize/widgets/docs/digitize-vs-sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/digitize-vs-sample.png -------------------------------------------------------------------------------- /straditize/widgets/docs/edit-samples-marks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/edit-samples-marks.png -------------------------------------------------------------------------------- /straditize/widgets/docs/edited-occurences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/edited-occurences.png -------------------------------------------------------------------------------- /straditize/widgets/docs/full-columns-widget.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/full-columns-widget.png -------------------------------------------------------------------------------- /straditize/widgets/docs/full-digitized-data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/full-digitized-data.png -------------------------------------------------------------------------------- /straditize/widgets/docs/removed-occurences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/removed-occurences.png -------------------------------------------------------------------------------- /straditize/widgets/docs/rounded-bar-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/rounded-bar-diagram.png -------------------------------------------------------------------------------- /straditize/widgets/docs/selected-occurences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/selected-occurences.png -------------------------------------------------------------------------------- /straditize/widgets/docs/straditizer-layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/straditizer-layout.png -------------------------------------------------------------------------------- /straditize/widgets/icons/intersect_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/icons/intersect_select.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/xaxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/xaxes.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/yaxes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/yaxes.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_cross_col.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_cross_col.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_noborders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_noborders.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_occurences.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_occurences.png -------------------------------------------------------------------------------- /tests/test_figures/colnames_diagram-Pinus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/colnames_diagram-Pinus.png -------------------------------------------------------------------------------- /straditize/widgets/docs/bar-diagram-splitting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/bar-diagram-splitting.png -------------------------------------------------------------------------------- /straditize/widgets/docs/basic_diagram_hlines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/basic_diagram_hlines.png -------------------------------------------------------------------------------- /straditize/widgets/docs/basic_diagram_vlines.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/basic_diagram_vlines.png -------------------------------------------------------------------------------- /straditize/widgets/docs/colnames-editor-col0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/colnames-editor-col0.png -------------------------------------------------------------------------------- /straditize/widgets/docs/sample_diagram-header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/sample_diagram-header.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_exaggerated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_exaggerated.png -------------------------------------------------------------------------------- /tests/test_figures/colnames_diagram-colnames.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/colnames_diagram-colnames.png -------------------------------------------------------------------------------- /straditize/widgets/docs/bar-diagram-digitization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/bar-diagram-digitization.png -------------------------------------------------------------------------------- /straditize/widgets/docs/bar-diagram-splitting2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/bar-diagram-splitting2.png -------------------------------------------------------------------------------- /straditize/widgets/docs/basic_diagram_cross_col.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/basic_diagram_cross_col.png -------------------------------------------------------------------------------- /straditize/widgets/docs/colnames-editor-colpic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/colnames-editor-colpic.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/data-part.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/data-part.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/move_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/move_large.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/right-line.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/right-line.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_disconnected_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_disconnected_01.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_disconnected_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_disconnected_02.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_disconnected_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_disconnected_03.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_hlines_removed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_hlines_removed.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_select_pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_select_pattern.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_select_removed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_select_removed.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_small_features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_small_features.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_vlines_removed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_vlines_removed.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_xaxes_removed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_xaxes_removed.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_yaxes_removed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_yaxes_removed.png -------------------------------------------------------------------------------- /straditize/widgets/docs/basic_diagram_disconnected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/basic_diagram_disconnected.png -------------------------------------------------------------------------------- /straditize/widgets/docs/basic_diagram_exaggerated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/basic_diagram_exaggerated.png -------------------------------------------------------------------------------- /straditize/widgets/docs/colnames-editor-colpic-HR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/colnames-editor-colpic-HR.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/column-starts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/column-starts.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/control-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/control-arrow.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/select-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/select-right.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_cross_col_removed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_cross_col_removed.png -------------------------------------------------------------------------------- /ci/recipe_clobber_osx.yaml: -------------------------------------------------------------------------------- 1 | test: 2 | commands: 3 | - straditize --help 4 | - pytest -v --cov=straditize tests/widgets/test_beginner.py 5 | - codecov 6 | -------------------------------------------------------------------------------- /readthedocs.yml: -------------------------------------------------------------------------------- 1 | conda: 2 | file: docs/environment.yml 3 | requirements_file: docs/requirements.txt 4 | python: 5 | version: 3 6 | setup_py_install: true 7 | -------------------------------------------------------------------------------- /straditize/widgets/docs/basic_diagram_disconnected_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/basic_diagram_disconnected_01.png -------------------------------------------------------------------------------- /straditize/widgets/docs/basic_diagram_disconnected_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/basic_diagram_disconnected_02.png -------------------------------------------------------------------------------- /straditize/widgets/docs/basic_diagram_disconnected_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/basic_diagram_disconnected_03.png -------------------------------------------------------------------------------- /straditize/widgets/docs/basic_diagram_small_features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/basic_diagram_small_features.png -------------------------------------------------------------------------------- /straditize/widgets/docs/colnames-editor-highlighted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/colnames-editor-highlighted.png -------------------------------------------------------------------------------- /straditize/widgets/docs/stacked-digitization-control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/stacked-digitization-control.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_disconnected_01_ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_disconnected_01_ref.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_disconnected_02_ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_disconnected_02_ref.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_disconnected_03_ref.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_disconnected_03_ref.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_features_at_col_ends.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_features_at_col_ends.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/beginner-tutorial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/beginner-tutorial.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/zoom_to_rect_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/zoom_to_rect_large.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_select_pattern_removed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_select_pattern_removed.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_select_removed_binary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_select_removed_binary.png -------------------------------------------------------------------------------- /tests/test_figures/data/bar_locations.dat: -------------------------------------------------------------------------------- 1 | # indices per bar. Each row contains the indices for one bar 2 | # in ../bar_diagram.png 3 | 0 3 4 | 8 11 5 | 11 14 6 | 17 20 7 | -------------------------------------------------------------------------------- /straditize/widgets/docs/basic_diagram_features_at_col_ends.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/basic_diagram_features_at_col_ends.png -------------------------------------------------------------------------------- /straditize/widgets/docs/colnames-editor-colpic-recognized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/colnames-editor-colpic-recognized.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/column-selection-tool.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/column-selection-tool.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/straditizer-control.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/straditizer-control.png -------------------------------------------------------------------------------- /straditize/widgets/docs/sample_diagram_digitize-explanation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/docs/sample_diagram_digitize-explanation.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/straditizer-control-cut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/straditizer-control-cut.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/select-x0-col0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/hoya-del-castillo/select-x0-col0.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_select_pattern_removed_20px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_select_pattern_removed_20px.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/tutorial-colnames-editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/tutorial-colnames-editor.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/charcoal-column.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/hoya-del-castillo/charcoal-column.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/select-data-lr1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/hoya-del-castillo/select-data-lr1.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/select-data-ul0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/hoya-del-castillo/select-data-ul0.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/select-data-ul1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/hoya-del-castillo/select-data-ul1.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/select-x0-col1-26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/hoya-del-castillo/select-x0-col1-26.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/select-x0-col27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/hoya-del-castillo/select-x0-col27.png -------------------------------------------------------------------------------- /tests/test_figures/basic_diagram_features_at_col_ends_removed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/tests/test_figures/basic_diagram_features_at_col_ends_removed.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/pollen-taxa-columns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/hoya-del-castillo/pollen-taxa-columns.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/matplotlib-navigation-toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/matplotlib-navigation-toolbar.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/colnames-editor-zoomed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/hoya-del-castillo/colnames-editor-zoomed.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/tutorial-colnames-editor-finished.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/beginner/tutorial-colnames-editor-finished.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-colnames.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-colnames.png -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/pollen-concentration-column.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Chilipp/straditize/HEAD/straditize/widgets/tutorial/hoya-del-castillo/pollen-concentration-column.png -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README.rst 2 | include LICENSE 3 | include straditize/widgets/icons/*.png 4 | include straditize/widgets/docs/*.rst 5 | include straditize/widgets/docs/*.png 6 | include straditize/widgets/tutorial/*/*.rst 7 | include straditize/widgets/tutorial/*/*.png 8 | -------------------------------------------------------------------------------- /straditize/widgets/docs/remove_col_ends.rst: -------------------------------------------------------------------------------- 1 | .. _features-at-column-ends: 2 | 3 | Remove features at column ends 4 | ============================== 5 | This function automatically finds the features that touch the end selects them 6 | for removement. 7 | 8 | .. image:: basic_diagram_features_at_col_ends.png 9 | -------------------------------------------------------------------------------- /straditize/widgets/docs/tools.rst: -------------------------------------------------------------------------------- 1 | .. _tools: 2 | 3 | Straditize helpers 4 | ================== 5 | 6 | Straditize has several generic tools to help you with various aspects. 7 | 8 | .. toctree:: 9 | 10 | selection_toolbar 11 | plot_control 12 | marker_control 13 | save_and_load 14 | -------------------------------------------------------------------------------- /tests/test_figures/data/full_data.csv: -------------------------------------------------------------------------------- 1 | ,0,1,2 2 | 0,2,3,2 3 | 1,2,3,2 4 | 2,2,3,2 5 | 3,2,3,2 6 | 4,2,2,2 7 | 5,2,2,3 8 | 6,2,2,3 9 | 7,2,2,3 10 | 8,2,2,3 11 | 9,2,3,2 12 | 10,2,3,2 13 | 11,2,4,1 14 | 12,2,4,1 15 | 13,2,4,1 16 | 14,3,3,1 17 | 15,3,3,1 18 | 16,3,3,1 19 | 17,4,2,1 20 | 18,4,2,1 21 | 19,4,2,1 22 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | - [ ] Closes #xxxx (remove if there is no corresponding issue, which should only be the case for minor changes) 2 | - [ ] Tests added (for all bug fixes or enhancements) 3 | - [ ] Tests passed (for all non-documentation changes) 4 | - [ ] Fully documented, including `CHANGELOG.rst` for all changes 5 | -------------------------------------------------------------------------------- /conda-recipe/menu-windows.json: -------------------------------------------------------------------------------- 1 | { 2 | "menu_name": "Straditize", 3 | "menu_items": 4 | [ 5 | { 6 | "name": "Straditize", 7 | "pywscript": "${PYTHON_SCRIPTS}/straditize-script.py", 8 | "workdir": "${PERSONALDIR}", 9 | "icon": "${MENU_DIR}/straditize.ico" 10 | } 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /docs/apigen.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # script to automatically generate the straditize api documentation using 3 | # sphinx-apidoc and sed 4 | sphinx-apidoc -P -f -M -e -T -o api ../straditize/ ../straditize/ocr.py 5 | # replace chapter title in sphinx_nbexamples.rst 6 | sed -i -e 1,1s/.*/'API Reference'/ api/straditize.rst 7 | sed -i -e 2,2s/.*/'============='/ api/straditize.rst 8 | -------------------------------------------------------------------------------- /straditize/widgets/docs/axes_translations.rst: -------------------------------------------------------------------------------- 1 | .. _axes-translations: 2 | 3 | Translating from pixel to data coordinates 4 | ========================================== 5 | All the previous steps in the digitization where in pixel coordinates. However, 6 | for the final output, we need to translate this into the real units of the 7 | diagram. 8 | 9 | .. toctree:: 10 | 11 | yaxis_translation 12 | xaxis_translation 13 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/beginner-tutorial-load-image.rst: -------------------------------------------------------------------------------- 1 | Load the image of the diagram 2 | ============================= 3 | 4 | The first step is to load the image of the diagram into straditize. 5 | 6 | 1. Click the |arrow| button at the top of the straditizer control. 7 | 2. Select the image file ``beginner-tutorial.png`` from your hard-disk and 8 | click Open 9 | 10 | .. |arrow| image:: run_arrow.png 11 | :width: 1.3em 12 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/beginner-tutorial-create-reader.rst: -------------------------------------------------------------------------------- 1 | Create the diagram reader 2 | ========================= 3 | Now you have to select, which type of diagram you are digitizing. In the 4 | example, it is an area diagram which is already selected in the dropdown menu next to the 5 | :guilabel:`Select data part` button. 6 | 7 | Click on :guilabel:`Convert image` to start the digitization. 8 | 9 | .. seealso:: 10 | 11 | :ref:`select-reader` 12 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-tutorial-load-image.rst: -------------------------------------------------------------------------------- 1 | Load the image of the diagram 2 | ============================= 3 | 4 | The first step is to load the image of the diagram into straditize. 5 | 6 | 1. Click the |arrow| button at the top of the straditizer control. 7 | 2. Select the image file ``hoya-del-castillo.png`` from your hard-disk and 8 | click Open 9 | 10 | .. |arrow| image:: run_arrow.png 11 | :width: 1.3em 12 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-tutorial-create-reader.rst: -------------------------------------------------------------------------------- 1 | Create the diagram reader 2 | ========================= 3 | Now you have to select, which type of diagram you are digitizing. In the 4 | example, it is an area diagram which is already selected in the dropdown menu next to the 5 | :guilabel:`Select data part` button. 6 | 7 | Click on :guilabel:`Convert image` to start the digitization. 8 | 9 | .. seealso:: 10 | 11 | :ref:`select-reader` 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/new_feature.md: -------------------------------------------------------------------------------- 1 | #### Summary 2 | [Describe the new requested feature in one or two lines. 3 | This should also be mentioned in the title of this issue.] 4 | 5 | #### Reason 6 | [Why do you think, this is useful?] 7 | 8 | #### Detailed explanation 9 | [Provide here some more explanation that goes beyond the summary above 10 | (or delete this paragraph, if everything is explained above)] 11 | 12 | #### Examples 13 | [images, code-snippets or URLs to other repositories] 14 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/beginner-tutorial-digitize.rst: -------------------------------------------------------------------------------- 1 | Digitizing the data 2 | =================== 3 | The next step, after we cleaned up the image, is the digitization of the 4 | diagram. Click the :guilabel:`Digitize` button. 5 | 6 | You now see the lines that result from the digitization. You can remove them 7 | in the `Plot control` section by clicking the |remove| button of the 8 | *Full digitized data* row. 9 | 10 | .. |remove| image:: invalid.png 11 | :width: 1.3em 12 | -------------------------------------------------------------------------------- /docs/environment.yml: -------------------------------------------------------------------------------- 1 | name: straditize_docs 2 | channels: 3 | - chilipp/label/dev 4 | - chilipp/label/master 5 | - chilipp 6 | dependencies: 7 | - python=3.7 8 | - psyplot-gui>=1.2.0 9 | - pygments 10 | - sphinx!=1.7.5 11 | - psy-simple>=1.2.0 12 | - psyplot>=1.2.0 13 | - netcdf4 14 | - openpyxl 15 | - scikit-image 16 | - scipy 17 | - psy-strat 18 | - pip: 19 | - autodocsumm 20 | - sphinx-argparse 21 | - sphinx-nbexamples 22 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-tutorial-digitize.rst: -------------------------------------------------------------------------------- 1 | Digitizing the data 2 | =================== 3 | The next step, after we cleaned up the image, is the digitization of the 4 | diagram. Click the :guilabel:`Digitize` button. 5 | 6 | You now see the lines that result from the digitization. You can remove them 7 | in the `Plot control` section by clicking the |remove| button of the 8 | *Full digitized data* row. 9 | 10 | .. |remove| image:: invalid.png 11 | :width: 1.3em 12 | -------------------------------------------------------------------------------- /docs/straditize_entry.bib: -------------------------------------------------------------------------------- 1 | 2 | @Article{SommerRechChevalierEtAl2019, 3 | author = {Philipp Sommer and Dilan Rech and Manuel Chevalier and Basil Davis}, 4 | title = {straditize: Digitizing stratigraphic diagrams}, 5 | journal = {Journal of Open Source Software}, 6 | year = {2019}, 7 | volume = {4}, 8 | number = {34}, 9 | pages = {1216}, 10 | month = {feb}, 11 | doi = {10.21105/joss.01216}, 12 | publisher = {The Open Journal}, 13 | url = {https://doi.org/10.21105/joss.01216}, 14 | } 15 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/beginner-tutorial-finish.rst: -------------------------------------------------------------------------------- 1 | Done! 2 | ===== 3 | That's it! You can export the samples (see :ref:`export`) to an Excel or CSV 4 | file via 5 | 6 | :menuselection:`File --> Export figures --> Straditizer data --> Samples` 7 | 8 | .. image:: export-final.png 9 | :width: 100% 10 | 11 | Now start with your own diagram! 12 | 13 | If you have questions or troubles, please open an issue on 14 | 15 | https://github.com/Chilipp/straditize/issues 16 | 17 | Thanks for using **straditize** and happy digitizing! 18 | -------------------------------------------------------------------------------- /straditize/widgets/docs/remove_cross_column.rst: -------------------------------------------------------------------------------- 1 | .. _cross-column: 2 | 3 | Remove cross-column features 4 | ============================ 5 | This function removes features that have a certain amount of pixels in 6 | multiple columns. Only those features are selected for removement, that 7 | have at least the given *Number of pixels* in more than one column of 8 | the stratigraphic diagram. 9 | 10 | .. image:: basic_diagram_cross_col.png 11 | 12 | .. note:: 13 | 14 | This feature should be called before intializing column specific 15 | readers. 16 | -------------------------------------------------------------------------------- /docs/command_line.rst: -------------------------------------------------------------------------------- 1 | .. highlight:: bash 2 | 3 | .. _command-line: 4 | 5 | Command line usage 6 | ================== 7 | The :mod:`straditize.__main__` module defines a simple parser to parse commands 8 | from the command line to load a diagram or a straditize project. 9 | 10 | It can be run from the command line via:: 11 | 12 | python -m straditize [options] [arguments] 13 | 14 | or simply:: 15 | 16 | straditize [options] [arguments] 17 | 18 | .. argparse:: 19 | :module: straditize.__main__ 20 | :func: get_parser 21 | :prog: straditize 22 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-tutorial-finish.rst: -------------------------------------------------------------------------------- 1 | Done! 2 | ===== 3 | That's it! You can export the samples (see :ref:`export`) to an Excel or CSV 4 | file via 5 | 6 | :menuselection:`File --> Export figures --> Straditizer data --> Samples` 7 | 8 | .. image:: export-final.png 9 | :width: 100% 10 | 11 | Now start with your own diagram! 12 | 13 | If you have questions or troubles, please open an issue on 14 | 15 | https://github.com/Chilipp/straditize/issues 16 | 17 | Thanks for using **straditize** and happy digitizing! 18 | -------------------------------------------------------------------------------- /straditize/widgets/docs/samples.rst: -------------------------------------------------------------------------------- 1 | .. _samples: 2 | 3 | Samples 4 | ======= 5 | samples are the source data that has been used to create the diagram 6 | (see :ref:`terminology`). The crucial part after the digitization of a 7 | diagram is to find out, where these samples exactly are. 8 | 9 | Straditize assists you with this through automatic sample finding 10 | algorithms, or you can load the sample locations from an external files 11 | or you just add and edit the samples manually. 12 | 13 | .. toctree:: 14 | 15 | find_samples 16 | load_samples 17 | edit_samples 18 | -------------------------------------------------------------------------------- /straditize/widgets/docs/straditize.rst: -------------------------------------------------------------------------------- 1 | .. _straditize-gui: 2 | 3 | Straditize GUI 4 | ============== 5 | 6 | .. image:: straditize.png 7 | :width: 50% 8 | :alt: straditize logo 9 | :align: center 10 | 11 | Welcome to the help explorer of the **Stra**\ tigraphic **Di**\ agram 12 | Digi\ **tize**\ r **straditize**. Here we guide you through the main 13 | functionality of the graphical user interface (GUI) and the necessary steps 14 | to digitze your stratigraphic diagram. 15 | 16 | .. toctree:: 17 | :includehidden: 18 | 19 | terminology 20 | straditize_steps 21 | tools 22 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/change_feature.md: -------------------------------------------------------------------------------- 1 | #### Summary 2 | [Describe the requested change in one or two lines. 3 | This should also be mentioned in the title of this issue.] 4 | 5 | #### Reason 6 | [Why do you think, this is useful?] 7 | 8 | #### Current behaviour 9 | [How is the current behaviour/framework?] 10 | 11 | #### New behaviour 12 | [Provide here some more explanation that goes beyond the summary above 13 | (or delete this paragraph, if everything is explained above), 14 | and describe the changes you would like to see] 15 | 16 | #### Examples 17 | [images, code-snippets or URLs to other repositories] 18 | -------------------------------------------------------------------------------- /docs/straditize_entry.enw: -------------------------------------------------------------------------------- 1 | %0 2 | %0 Journal Article 3 | %A Sommer, Philipp; Rech, Dilan; Chevalier, Manuel & Davis, Basil 4 | %D 2019 5 | %T straditize: Digitizing stratigraphic diagrams 6 | %E 7 | %B Journal of Open Source Software 8 | %C 9 | %I The Open Journal 10 | %V 4 11 | %6 12 | %N 34 13 | %P 1216 14 | %& 15 | %Y 16 | %S 17 | %7 18 | %8 feb 19 | %9 20 | %? 21 | %! 22 | %Z 23 | %@ 24 | %( 25 | %) 26 | %* 27 | %L 28 | %M 29 | 30 | %2 31 | %3 article 32 | %4 33 | %# 34 | %$ 35 | %F SommerRechChevalierEtAl2019 36 | %K 37 | %X 38 | %Z 39 | %U https://doi.org/10.21105/joss.01216 40 | 41 | %+ 42 | %^ 43 | 44 | -------------------------------------------------------------------------------- /straditize/widgets/docs/remove_small_parts.rst: -------------------------------------------------------------------------------- 1 | .. _remove-small: 2 | 3 | Remove small artifacts 4 | ====================== 5 | This method recognizes small artifacts using the 6 | :meth:`skimage.morphology.remove_small_objects` 7 | method. 8 | 9 | .. image:: basic_diagram_small_features.png 10 | 11 | The pixel size of the artifacts can be determined through 12 | the *Smaller than* field and you can always modify the 13 | selection through the tools in the selection toolbar. 14 | 15 | If you want a better visualization of the small artifacts 16 | that will be removed, use the *Highlight selection smaller than* 17 | button. 18 | 19 | -------------------------------------------------------------------------------- /straditize/widgets/docs/load_samples.rst: -------------------------------------------------------------------------------- 1 | .. _load-samples: 2 | 3 | Load samples locations from external file 4 | ========================================= 5 | samples can be loaded from an external CSV (comma-separated) file. The 6 | first column in this CSV file is expected to represent the y-locations of the 7 | samples. If the y-axis scale has already been specified (see 8 | :ref:`yaxis-translation`), this data should be on the same scale. Otherwise, 9 | we assume that the data is in pixel coordinates. 10 | 11 | .. warning:: 12 | 13 | Make sure, that you first entered the correct 14 | :ref:`y-axis scale `. Otherwise the samples might 15 | not be interpreted correctly. 16 | -------------------------------------------------------------------------------- /straditize/widgets/docs/straditize_steps.rst: -------------------------------------------------------------------------------- 1 | .. _straditize-steps: 2 | 3 | Straditization steps 4 | ==================== 5 | 6 | Straditize provides you lot's of possibilities for customizing the 7 | semi-automatic digitization of your diagram. However, there are certain steps 8 | that you should follow. You may not need all of them and you may exchange them 9 | to a certain degree as well. 10 | 11 | .. toctree:: 12 | :numbered: 1 13 | 14 | load_image 15 | select_data_part 16 | select_reader 17 | select_column_starts 18 | column_names 19 | removing_features 20 | child_readers 21 | exaggerations 22 | occurences 23 | digitize 24 | samples 25 | axes_translations 26 | export 27 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/beginner-tutorial-xaxis-translation.rst: -------------------------------------------------------------------------------- 1 | Translating the x-axis 2 | ====================== 3 | As we did for the y-axes, we do it for the x-axes. 4 | 5 | 1. Click the :guilabel:`Insert X-axis values` button in the `Axes translations` 6 | section of the straditizer control 7 | 2. A small dialog will appear where you should enter the value at the column 8 | start (in our case, 0) 9 | 3. Shift-leftclick on the plot to enter another x-value. 10 | 11 | .. image:: select-x0_1.png 12 | 13 | 4. A small dialog will appear where you should enter the x-value to use 14 | 15 | .. image:: select-x0_2.png 16 | 17 | 5. Click the :guilabel:`Apply` button at the bottom of the straditizer control 18 | when you are done. 19 | -------------------------------------------------------------------------------- /icon/CreateICNS.sh: -------------------------------------------------------------------------------- 1 | mkdir main.iconset 2 | sips -z 16 16 icon1024.png --out main.iconset/icon_16x16.png 3 | sips -z 32 32 icon1024.png --out main.iconset/icon_16x16@2x.png 4 | sips -z 32 32 icon1024.png --out main.iconset/icon_32x32.png 5 | sips -z 64 64 icon1024.png --out main.iconset/icon_32x32@2x.png 6 | sips -z 128 128 icon1024.png --out main.iconset/icon_128x128.png 7 | sips -z 256 256 icon1024.png --out main.iconset/icon_128x128@2x.png 8 | sips -z 256 256 icon1024.png --out main.iconset/icon_256x256.png 9 | sips -z 512 512 icon1024.png --out main.iconset/icon_256x256@2x.png 10 | sips -z 512 512 icon1024.png --out main.iconset/icon_512x512.png 11 | cp icon1024.png main.iconset/icon_512x512@2x.png 12 | iconutil -c icns main.iconset 13 | rm -R main.iconset 14 | -------------------------------------------------------------------------------- /straditize/version.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Version string of straditize 3 | 4 | **Disclaimer** 5 | 6 | Copyright (C) 2018-2019 Philipp S. Sommer 7 | 8 | This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see .""" 20 | __version__ = '0.1.3.post1' 21 | 22 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-tutorial-column-starts.rst: -------------------------------------------------------------------------------- 1 | Identifying the columns 2 | ======================= 3 | The next step is, to automatically separate the columns from each other. This 4 | is simple in our case, since straditize can separate them automatically. 5 | 6 | 1. Click the :guilabel:`Column starts` button. You will see several vertical 7 | blue lines appearing on the plot that you can drag and drop such as you did 8 | it when selecting the diagram part. You can change their colors using the 9 | :ref:`marker control ` 10 | 2. straditize recognizes these columns automatically and in our example, you 11 | do not have to edit them. Therefore hit the :guilabel:`Apply` button at the 12 | bottom of the control and you are done. 13 | 14 | 15 | .. seealso:: 16 | 17 | :ref:`col-starts` 18 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/beginner-tutorial-column-starts.rst: -------------------------------------------------------------------------------- 1 | Selecting the columns 2 | ===================== 3 | The next step is, to separate the columns, i.e. to tell straditize where each 4 | of the sub diagrams start. 5 | 6 | .. image:: column-starts.png 7 | 8 | This is simple in our case, since straditize can 9 | separate them automatically. 10 | 11 | 1. Click the :guilabel:`Column starts` button. You will see several vertical 12 | blue lines appearing on the plot that you can drag and drop such as you did 13 | it when selecting the diagram part. You can change their colors using the 14 | :ref:`marker control ` 15 | 2. straditize recognizes these columns automatically and in our example, you 16 | do not have to edit them. Therefore hit the :guilabel:`Apply` button at the 17 | bottom of the control and you are done. 18 | 19 | 20 | .. seealso:: 21 | 22 | :ref:`col-starts` 23 | -------------------------------------------------------------------------------- /ci/deploy_anaconda.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import re 4 | import conda_build.api 5 | import subprocess as spr 6 | fnames = list(conda_build.api.get_output_file_paths('conda-recipe')) 7 | py_patt = re.compile('py\d\d') 8 | repl = 'py' + os.getenv('PYTHON_VERSION').replace('.', '') 9 | fnames = [py_patt.sub(repl, f) for f in fnames] 10 | if os.getenv("TRAVIS") == "true": 11 | branch = os.getenv("TRAVIS_BRANCH") 12 | on_release = os.getenv("TRAVIS_TAG") != "" 13 | else: 14 | branch = os.getenv("APPVEYOR_REPO_BRANCH") 15 | on_release = bool(os.getenv("APPVEYOR_REPO_TAG_NAME")) 16 | label = ['-l', branch] if not on_release else [] 17 | token = ['-t', os.getenv('CONDA_REPO_TOKEN')] 18 | 19 | print("Uploading via " + 20 | " ".join(['anaconda -t *****', 'upload', '--force'] + label + fnames)) 21 | 22 | spr.check_call( 23 | ['anaconda'] + token + ['upload', '--force'] + 24 | label + fnames 25 | ) 26 | -------------------------------------------------------------------------------- /straditize/widgets/docs/find_samples.rst: -------------------------------------------------------------------------------- 1 | .. _find-samples: 2 | 3 | Automatic samples identification 4 | ================================ 5 | straditize has reader specific sample identification algorithms 6 | implemented. The overall algorithm is based on two steps: 7 | 8 | 1. For each column: Identify the intervals that contain exactly one 9 | samples (the rough locations) 10 | 2. Align the overlapping intervals between the columns to estimate the exact 11 | location 12 | 13 | Where step 2 is the same for all diagram types, step one is diagram specific. 14 | For bar diagrams, we use the bars that have been identified during 15 | the digitization (see :ref:`digitizing-bars`). 16 | 17 | For area and line diagrams on the other hand, we identify the local extrema 18 | (minima and maxima) for each column. This strategy works well for pollen 19 | diagrams since they are supposed to sum up to 100%. However, this does not 20 | generally work for all stratigraphic diagrams. 21 | -------------------------------------------------------------------------------- /straditize/widgets/docs/export.rst: -------------------------------------------------------------------------------- 1 | .. _export: 2 | 3 | Export your results 4 | =================== 5 | Once you found the samples and added the y-axis and x-axis transformations, 6 | you can export them to a comma-separated (CSV) or an Excel file. 7 | 8 | Just use the export menu via 9 | 10 | :menuselection:`File --> Export figures --> Straditizer data --> Samples` 11 | 12 | .. only:: html 13 | 14 | or hit :kbd:`Control-E` (:kbd:`⌘-E` on MacOS) 15 | 16 | .. only:: not html 17 | 18 | or hit :kbd:`Control-E` (:kbd:`Command-E` on MacOS) 19 | 20 | .. image:: export-final.png 21 | :width: 100% 22 | 23 | If you want to export the full digitized data, i.e. not only the samples, use 24 | 25 | :menuselection:`File --> Export figures --> Straditizer data --> Full data` 26 | 27 | .. only:: html 28 | 29 | or hit :kbd:`Shift-Control-E` (:kbd:`⇧-⌘-E` on MacOS) 30 | 31 | .. only:: not html 32 | 33 | or hit :kbd:`Shift-Control-E` (:kbd:`Shift-Command-E` on MacOS) 34 | -------------------------------------------------------------------------------- /straditize/widgets/docs/select_column_ends.rst: -------------------------------------------------------------------------------- 1 | .. _col-ends: 2 | 3 | Select the ends for each column 4 | =============================== 5 | A pollen diagram is defined through different columns, each column 6 | represents one taxa, species, PFT, etc.. To digitize the data, we have to know, 7 | where each column starts and ends exactly. 8 | 9 | After having clicked the :guilabel:`Column starts` button, the software 10 | automatically estimates the starts of the columns and, based on that, the 11 | column ends as well. Clicking the :guilabel:`ends` button however lets 12 | you modify the automatically estimated column ends. 13 | 14 | .. image:: full-columns-widget.png 15 | :width: 50% 16 | :align: center 17 | 18 | As for the :ref:`column starts `, there are two ways to modify 19 | the column ends: 20 | 21 | 1. Hold the :kbd:`Shift` button and left-click on the plot to create a 22 | new vertical mark. 23 | 24 | Then Left-click the mark and drag it to the start of one column. 25 | 2. Delete a column start by right-clicking the mark. 26 | 27 | .. seealso:: 28 | 29 | - :ref:`align-cols` 30 | - :ref:`col-starts` 31 | -------------------------------------------------------------------------------- /docs/tutorial/index.rst: -------------------------------------------------------------------------------- 1 | .. _tutorial: 2 | 3 | Straditize Tutorial 4 | =================== 5 | To introduce you into straditize, we implemented a tutorial into the graphical 6 | user interface. 7 | 8 | To start it in the GUI, click the :guilabel:`Tutorial` button at the bottom of 9 | the straditizer control. 10 | 11 | .. image:: tutorial-button.png 12 | 13 | 14 | Tutorials 15 | --------- 16 | 17 | .. toctree:: 18 | :maxdepth: 1 19 | :hidden: 20 | 21 | beginner/beginner-tutorial-intro 22 | hoya-del-castillo/hoya-del-castillo-tutorial-intro 23 | 24 | 25 | .. raw:: html 26 | 27 |
28 | 29 | .. only:: html 30 | 31 | .. figure:: /tutorial/thumb/beginner-tutorial-thumb.png 32 | 33 | :ref:`beginner-tutorial` 34 | 35 | .. raw:: html 36 | 37 |
38 | 39 | 40 | .. raw:: html 41 | 42 |
43 | 44 | .. only:: html 45 | 46 | .. figure:: /tutorial/thumb/hoya-del-castillo-thumb.png 47 | 48 | :ref:`area-tutorial` 49 | 50 | .. raw:: html 51 | 52 |
53 | -------------------------------------------------------------------------------- /straditize/widgets/docs/align_columns.rst: -------------------------------------------------------------------------------- 1 | .. _align-cols: 2 | 3 | Align the columns vertically 4 | ============================ 5 | Sometimes the columns are not aligned properly which makes it hard to identify 6 | where the exact sample is located and might lead to misinterpretations 7 | of samples. To correct this, we implemented a methodology to align the 8 | columns. 9 | 10 | After having clicked the :guilabel:`Align columns` button, multiple marks are 11 | created. To correct the vertical displacement, move those marks to the vertical 12 | position in each column, that should be on the same vertical level. 13 | 14 | You can select the horizontal lines for moving multiple marks and the vertical 15 | line for selecting only one mark. 16 | 17 | 1. Select one mark on one column by clicking on it's vertical line 18 | 19 | .. image:: align_column1.png 20 | 21 | 2. Move the mark vertically (the horizontal line does not matter) 22 | 23 | .. image:: align_column1-2.png 24 | 25 | 3. Select another mark of another column 26 | 27 | .. image:: align_column2.png 28 | 29 | 4. Move this mark to a point that should have the same y-value as the first 30 | mark 31 | 32 | .. image:: align_column2-2.png 33 | 34 | 5. Click the :guilabel:`Apply` button 35 | -------------------------------------------------------------------------------- /straditize/widgets/docs/child_readers.rst: -------------------------------------------------------------------------------- 1 | .. _child-readers: 2 | 3 | Column specific readers 4 | ======================= 5 | 6 | .. note:: 7 | 8 | If the entire diagram is just based on one diagram type (see 9 | :ref:`select-reader`), you can skip this step. 10 | 11 | As noted in the :ref:`reader selection section `, you can 12 | choose different readers for different columns in order to account for multiple 13 | subdiagram styles within the stratigraphic diagram. The current reader, i.e. 14 | the one that is selected in the `Current reader` tab in the 15 | `Digitization control` is the one that can be accessed via the 16 | ``stradi.data_reader`` attribute in the console. It is also sometimes referred 17 | to as the `parent reader`. 18 | 19 | Clicking the :guilabel:`+` button in the `Current reader` tab let's you select 20 | columns just by clicking on the data image. 21 | 22 | .. image:: child-readers.png 23 | :width: 100% 24 | 25 | After you selected the necessary columns, hit the :guilabel:`Apply` button. In 26 | the appearing window, select the reader type you want (see 27 | :ref:`select-reader`). You now initialized a new child reader for the selected 28 | columns that can be set as the parent reader using the dropdown menu in the 29 | `Current reader` tab. 30 | -------------------------------------------------------------------------------- /straditize/widgets/docs/select_data_part.rst: -------------------------------------------------------------------------------- 1 | .. _select-data: 2 | 3 | Select the diagram part 4 | ======================= 5 | The second step involves selecting the diagram part (see the 6 | :ref:`terminology`) by clicking the :guilabel:`Select data part` button in the 7 | digitization control. 8 | 9 | The goal is to select the two outer corners of the diagram and try to avoid 10 | vertical and horizontal axes or axes description. 11 | 12 | 1. :kbd:`Shift` - leftclick on the data diagram. This will create a mark at 13 | your current mouse location. 14 | 2. Click on the cross to select it 15 | 16 | .. image:: select_mark.png 17 | 18 | 3. Hold the left mouse button and drag the cross to the upper left corner of 19 | the diagram. Make sure you don't include the y-axis ticks (i.e. the numbers 20 | on the y-axis) 21 | 22 | .. image:: drag_mark.png 23 | 24 | 4. Create another mark by another :kbd:`Shift` - leftclick 25 | 5. Move the cross to the lower right corner of the diagram. Make sure you don't 26 | include the x-axis ticks (i.e. the numbers on the x-axis) 27 | 28 | .. image:: drag_mark2.png 29 | 30 | 6. Click the :guilabel:`Apply` button at the bottom 31 | 32 | If you want to change the appearance of the marks, see the `Marker control` 33 | section in the straditizer control panel. 34 | -------------------------------------------------------------------------------- /CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | v0.1.3 2 | ====== 3 | Patch that forces the diagram limits to be integers. 4 | 5 | v0.1.2 6 | ====== 7 | This release contains several small bug fixes, mainly for the bar data reader 8 | and for duplicated samples and occurences. 9 | 10 | 11 | v0.1.1 12 | ====== 13 | .. image:: http://joss.theoj.org/papers/10.21105/joss.01216/status.svg 14 | :alt: Journal of Open Source Software 15 | :target: https://doi.org/10.21105/joss.01216 16 | 17 | .. image:: https://zenodo.org/badge/128653545.svg 18 | :alt: zenodo 19 | :target: https://zenodo.org/badge/latestdoi/128653545 20 | 21 | This release has been approved by the Journal of Open Source Software 22 | (JOSS) in https://github.com/openjournals/joss-reviews/issues/1216 23 | 24 | Added 25 | ----- 26 | * Changelog 27 | 28 | Changed 29 | ------- 30 | * Thanks to the feedbacks from `@ixjlyons `__ and 31 | `@sgrieve `__ the installation instructions and 32 | some other documentation instructions have been improved (see the issues 33 | https://github.com/Chilipp/straditize/issues/1, 34 | https://github.com/Chilipp/straditize/issues/2, 35 | https://github.com/Chilipp/straditize/issues/3, 36 | https://github.com/Chilipp/straditize/issues/4 and 37 | https://github.com/Chilipp/straditize/issues/8) 38 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-tutorial-select-data.rst: -------------------------------------------------------------------------------- 1 | Select the diagram part 2 | ======================= 3 | The second step involves selecting the diagram part. This is the part where 4 | your data is displayed, but without the vertical and horizontal axes or axes 5 | descriptions. 6 | 7 | Being exact in this step significantly reduces the later work and simplifies 8 | the automatic digitization. 9 | 10 | 1. Click the :guilabel:`Select data part` button in the digitization control. 11 | 2. Click on the upper left cross to select it 12 | 13 | .. image:: select-data-ul0.png 14 | 15 | 3. Hold the left mouse button and drag the cross to the upper left corner of 16 | the diagram. Make sure you don't include the y-axis and x-axis ticks. 17 | 18 | You can also use the zoom and navigation tools in the figure toolbar for 19 | navigation. 20 | 21 | .. image:: select-data-ul1.png 22 | 23 | 5. Now select the cross at the lower right corner of the diagram and move it 24 | such that you don't 25 | include the x-axis ticks (i.e. the numbers on the x-axis) 26 | 27 | .. image:: select-data-lr1.png 28 | 29 | 6. Click the :guilabel:`Apply` button at the bottom 30 | 31 | If you want to change the appearance of the marks, see the `Marker control` 32 | section in the straditizer control panel. 33 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Tutorials for straditize 3 | 4 | The :mod:`~straditize.widgets.tutorial.beginner` tutorial serves as a first 5 | look into the software. The 6 | :mod:`~straditize.widgets.tutorial.hoya_del_castillo` tutorial on the other 7 | hand is a true pollen diagram with more than 20 taxa. Both tutorials can be 8 | started from the GUI through the :guilabel:`Tutorial` button. 9 | 10 | **Disclaimer** 11 | 12 | Copyright (C) 2018-2019 Philipp S. Sommer 13 | 14 | This program is free software: you can redistribute it and/or modify 15 | it under the terms of the GNU General Public License as published by 16 | the Free Software Foundation, either version 3 of the License, or 17 | (at your option) any later version. 18 | 19 | This program is distributed in the hope that it will be useful, 20 | but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | GNU General Public License for more details. 23 | 24 | You should have received a copy of the GNU General Public License 25 | along with this program. If not, see . 26 | """ 27 | from straditize.widgets.tutorial.beginner import Tutorial 28 | from straditize.widgets.tutorial.hoya_del_castillo import ( 29 | HoyaDelCastilloTutorial) 30 | -------------------------------------------------------------------------------- /straditize/widgets/docs/load_image.rst: -------------------------------------------------------------------------------- 1 | .. _load_image: 2 | 3 | Load a diagram 4 | ============== 5 | The first step is to load the picture of your diagram. 6 | 7 | 1. If you are starting straditize from the psyplot GUI (i.e. not via typing 8 | ``straditize`` in the terminal or through the app), you should first switch 9 | to the straditizer layout via 10 | 11 | :menuselection:`Windows --> Window layouts --> Straditizer layout`. 12 | 13 | .. image:: straditizer-layout.png 14 | :width: 100% 15 | 16 | This will show you the straditizer control panel. 17 | 18 | 2. To load the picture of your diagram, select 19 | 20 | :menuselection:`File --> Open project --> Open straditizer --> Project or image` 21 | 22 | .. image:: load-image.png 23 | :width: 100% 24 | 25 | and select the image file you want to load. 26 | 27 | .. only:: html 28 | 29 | Alternatively, you can use the use the :kbd:`Control-O` (:kbd:`⌘-O` on 30 | MacOS) keyboard shortcut or the |arrow| button at the top of the 31 | straditizer control. 32 | 33 | .. only:: not html 34 | 35 | Alternatively, you can use the :kbd:`Control-O` (:kbd:`Command-O` on 36 | MacOS) keyboard shortcut or the |arrow| button at the top of the 37 | straditizer control. 38 | 39 | .. |arrow| image:: run_arrow.png 40 | :width: 1.3em 41 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | environment: 2 | matrix: 3 | - PYTHON: "C:\\Miniconda36-x64" 4 | PYTHON_ARCH: "64" 5 | PYTHON_VERSION: 3.7 6 | - PYTHON: "C:\\Miniconda36-x64" 7 | PYTHON_ARCH: "64" 8 | PYTHON_VERSION: 3.6 9 | 10 | install: 11 | # windows config (for installation) 12 | - cmd: "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" 13 | - cmd: setlocal 14 | - cmd: set CONDA_REPO_TOKEN= 15 | # conda config 16 | - conda config --set always_yes yes --set changeps1 no 17 | - conda config --add channels conda-forge 18 | - conda config --add channels chilipp 19 | - conda config --add channels chilipp/label/master 20 | - conda config --add channels chilipp/label/dev 21 | - conda update -q conda 22 | - conda install conda-build anaconda-client 23 | - conda info -a 24 | - conda list 25 | # windows config 26 | - cmd: endlocal 27 | - cmd: 'SET PYTHONWARNINGS=ignore:mode:DeprecationWarning:docutils.io:245' 28 | - cmd: "IF NOT DEFINED APPVEYOR_REPO_TAG_NAME (SET GIT_BRANCH=%APPVEYOR_REPO_BRANCH%)" 29 | 30 | build: off 31 | 32 | test_script: 33 | - cmd: setlocal 34 | - cmd: set CONDA_REPO_TOKEN= 35 | - cmd: conda build conda-recipe --python %PYTHON_VERSION% 36 | - cmd: endlocal 37 | 38 | deploy_script: 39 | - cmd: "python ci\\deploy_anaconda.py" 40 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-tutorial-column-names.rst: -------------------------------------------------------------------------------- 1 | Specifying the column names 2 | =========================== 3 | 4 | .. note:: 5 | 6 | Straditize also has a text recognition implemented if you install 7 | ``tesserocr`` (see the :ref:`user guide `). If you would like 8 | to use it, install ``tesserocr`` and restart the tutorial. 9 | 10 | Straditize can handle column names which will then be included in the final 11 | export. 12 | 13 | 1. Expand the `Column names` item in the straditizer control and click the 14 | :guilabel:`Edit column names` button 15 | 2. In the appearing widget, the colnames editor 16 | 17 | .. image:: colnames-editor.png 18 | :alt: column names editor 19 | 20 | you find a table where you can edit the column names. The plot on it's left 21 | also shows a rotated version of the diagram, to help you identifying the 22 | column names. You can navigate in this plot using leftclick and zoom in and 23 | out using right-click (see 24 | `matplotlibs docs on interactive navigation with the Pan/Zoom-tool`_) 25 | 3. When you entered the correct names in the table, click the 26 | :guilabel:`Edit column names` button again to hide the dialog. 27 | 28 | .. _matplotlibs docs on interactive navigation with the Pan/Zoom-tool: https://matplotlib.org/users/navigation_toolbar.html 29 | -------------------------------------------------------------------------------- /straditize/widgets/docs/select_column_starts.rst: -------------------------------------------------------------------------------- 1 | .. _col-starts: 2 | 3 | Select the starts for each column 4 | ================================= 5 | 6 | A stratigraphic diagram is defined through different columns, each column 7 | represents one variable (or for pollen diagrams, one taxa, species, PFT, etc.). 8 | To digitize the data, we have to know, where each of these column starts 9 | exactly. 10 | 11 | .. image:: columns.png 12 | :width: 100% 13 | 14 | After having clicked the :guilabel:`Column starts` button, the software 15 | automatically estimates the starts of the columns. However, you should check 16 | whether they are all recognized correctly. 17 | 18 | .. image:: columns-widget.png 19 | :width: 50% 20 | :align: center 21 | 22 | There are several possibilities to edit the automatically estimated columns: 23 | 24 | 1. Hold the :kbd:`Shift` button and left-click on the plot to create a 25 | new vertical mark. 26 | 27 | Then Left-click the mark and drag it to the start of one column. 28 | 2. Delete a column start by right-clicking the mark. 29 | 3. Modify the `threshold`. It defines the percentage of a pixel column that has 30 | to be covered to assume a valid column start. If you have columns that only 31 | contain a very small amount of data, you should lower it 32 | 33 | .. seealso:: 34 | 35 | .. toctree:: 36 | 37 | select_column_ends 38 | align_columns 39 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/beginner-tutorial-samples.rst: -------------------------------------------------------------------------------- 1 | Finding and editing samples 2 | =========================== 3 | So far, we have one data point per pixel in the image. However, we have to 4 | identify the locations of the samples in order to reproduce the original data. 5 | 6 | Straditize assists you with this through automatic sample finding 7 | algorithms, or you can load the sample locations from an external files 8 | or you just add and edit the samples manually. 9 | 10 | 1. Expand the `Samples` item in the digitization control 11 | 2. Find the samples by clicking the :guilabel:`Find samples` button. straditize 12 | now identified the sample locations based on the extrema in the columns 13 | (see :ref:`find-samples` for an explanation of the algorithms). 14 | 3. To visualize the samples, you can again use the items in the `Plot control` 15 | tab. However, you can (and should!) also edit them by clicking the 16 | :guilabel:`Edit samples` button. 17 | 4. Now you see one horizontal line per sample that you can drag around 18 | (left-click), delete (right-click) or you can also add new samples 19 | (Shift + left-click). See the :ref:`edit-samples` section for more details. 20 | 5. Finally, click the :guilabel:`Apply` button or the :guilabel:`Cancel` 21 | button to stop the editing of the samples. 22 | 23 | You're almost done! Your diagram is now digitized and the data could already 24 | be exported. 25 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-tutorial-samples.rst: -------------------------------------------------------------------------------- 1 | Finding and editing samples 2 | =========================== 3 | So far, we have one data point per pixel in the image. However, we have to 4 | identify the locations of the samples in order to reproduce the original data. 5 | 6 | Straditize assists you with this through automatic sample finding 7 | algorithms, or you can load the sample locations from an external files 8 | or you just add and edit the samples manually. 9 | 10 | 1. Expand the `Samples` item in the digitization control 11 | 2. Find the samples by clicking the :guilabel:`Find samples` button. straditize 12 | now identified the sample locations based on the extrema in the columns 13 | (see :ref:`find-samples` for an explanation of the algorithms). 14 | 3. To visualize the samples, you can again use the items in the `Plot control` 15 | tab. However, you can (and should!) also edit them by clicking the 16 | :guilabel:`Edit samples` button. 17 | 4. Now you see one horizontal line per sample that you can drag around 18 | (left-click), delete (right-click) or you can also add new samples 19 | (Shift + left-click). See the :ref:`edit-samples` section for more details. 20 | 5. Finally, click the :guilabel:`Apply` button or the :guilabel:`Cancel` 21 | button to stop the editing of the samples. 22 | 23 | You're almost done! Your diagram is now digitized and the data could already 24 | be exported. 25 | -------------------------------------------------------------------------------- /straditize/widgets/docs/remove_lines.rst: -------------------------------------------------------------------------------- 1 | .. _remove-lines: 2 | 3 | Remove horizontal or vertical lines 4 | =================================== 5 | The features described here automatically remove the y- and x-axes, or in 6 | general vertical or horizontal lines that span a certain fraction of the 7 | diagram part. 8 | 9 | The methodology is simple: If a certain pixel column or 10 | row in the binary data image is covered, it is considered 11 | as a vertical or horizontal line, respectively. 12 | 13 | +------------------+----------------+ 14 | | x-axes | y-axes | 15 | +------------------+----------------+ 16 | | |xaxes| | |yaxes| | 17 | +------------------+----------------+ 18 | | horizontal lines | vertical lines | 19 | +------------------+----------------+ 20 | | |hlines| | |vlines| | 21 | +------------------+----------------+ 22 | 23 | .. |xaxes| image:: basic_diagram_xaxes.png 24 | 25 | .. |yaxes| image:: basic_diagram_yaxes.png 26 | 27 | .. |hlines| image:: basic_diagram_hlines.png 28 | 29 | .. |vlines| image:: basic_diagram_vlines.png 30 | 31 | You can modify the recognition using three options 32 | 33 | Minimum fraction: 34 | This is the minimum fraction of a pixel column (for 35 | or row that must be covered 36 | Minimum line width: 37 | Lines are only selected, if their line width is greater than 38 | or equal to the given minimum axis width. 39 | Maximum line width: 40 | Lines are only selected up to the given maximum axis width 41 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-tutorial-meta.rst: -------------------------------------------------------------------------------- 1 | Editing the meta attributes 2 | =========================== 3 | To keep the overview on your project, you can save some meta informations 4 | to it, for example, where you have the diagram from and what it represents. 5 | 6 | Here for example, we know that the digitized data represents a pollen core 7 | from *Hoya del Castillo* and has been described in detail in [Basil1980]. 8 | 9 | 1. Click the :guilabel:`Attributes` button at the bottom of the straditizer 10 | control. You know see a table with attributes, that you can rename, delete 11 | and fill according to your needs. 12 | 2. Fill the data table: 13 | 14 | .. list-table:: 15 | 16 | * - Digitized by 17 | - Your name 18 | * - sitename 19 | - Hoya del Castillo 20 | * - Lon 21 | - -0.5 22 | * - Lat 23 | - 41.25 24 | * - Archive 25 | - Pollen 26 | * - Country 27 | - Spain 28 | * - Restricted 29 | - No 30 | * - Reference 31 | - Davis, Basil A. S., and A. C. Stevenson. "The 8.2ka Event and 32 | Early-Mid Holocene Forests, Fires and Flooding in the Central Ebro 33 | Desert, NE Spain." Quat. Sci. Rev. , vol. 26, no. 13-14, 2007, pp. 34 | 1695-712 35 | * - DOI 36 | - 10.1016/j.quascirev.2007.04.007 37 | 38 | 39 | .. note:: 40 | 41 | You can also add new attributes by clicking 42 | :menuselection:`Rightclick --> Insert 1 row` inside the table 43 | -------------------------------------------------------------------------------- /.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 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | *.egg-info/ 23 | .installed.cfg 24 | *.egg 25 | 26 | # PyInstaller 27 | # Usually these files are written by a python script from a template 28 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 29 | *.manifest 30 | *.spec 31 | 32 | # Installer logs 33 | pip-log.txt 34 | pip-delete-this-directory.txt 35 | 36 | # Unit test / coverage reports 37 | htmlcov/ 38 | .tox/ 39 | .coverage 40 | .coverage.* 41 | .cache 42 | nosetests.xml 43 | coverage.xml 44 | *,cover 45 | .pytest_cache/* 46 | 47 | # Translations 48 | *.mo 49 | *.pot 50 | 51 | # Django stuff: 52 | *.log 53 | 54 | # Sphinx documentation 55 | docs/_build/ 56 | docs/index.doctree 57 | docs/gui/ 58 | docs/api/ 59 | docs/tutorial/beginner 60 | docs/tutorial/hoya-del-castillo 61 | 62 | # test results 63 | matplotlibrc 64 | *psyplot_testresults 65 | tests/envs/cov_psyplot_py* 66 | tests/envs/psyplot_py*.html 67 | 68 | # PyBuilder 69 | target/ 70 | 71 | # Spyder project 72 | .spyderproject 73 | 74 | # Example ipython notebook checkpoints 75 | *.ipynb_checkpoints/ 76 | 77 | # test pictures 78 | tests/test_diagram*.png 79 | tests/chinese.* 80 | 81 | *.pkl 82 | 83 | # installers 84 | straditize-conda-*.sh 85 | straditize-conda-*.exe 86 | 87 | # paper.pdf 88 | paper/paper.pdf 89 | -------------------------------------------------------------------------------- /straditize/common.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Module of commonly use python objects 3 | 4 | **Disclaimer** 5 | 6 | Copyright (C) 2018-2019 Philipp S. Sommer 7 | 8 | This program is free software: you can redistribute it and/or modify 9 | it under the terms of the GNU General Public License as published by 10 | the Free Software Foundation, either version 3 of the License, or 11 | (at your option) any later version. 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see . 20 | """ 21 | from docrep import DocstringProcessor 22 | 23 | docstrings = DocstringProcessor() 24 | 25 | 26 | def rgba2rgb(image, color=(255, 255, 255)): 27 | """Alpha composite an RGBA Image with a specified color. 28 | 29 | Source: http://stackoverflow.com/a/9459208/284318 30 | 31 | Parameters 32 | ---------- 33 | image: PIL.Image 34 | The PIL RGBA Image object 35 | color: tuple 36 | The rgb color for the background 37 | 38 | Returns 39 | ------- 40 | PIL.Image 41 | The rgb image 42 | """ 43 | from PIL import Image 44 | image.load() # needed for split() 45 | background = Image.new('RGB', image.size, color) 46 | background.paste(image, mask=image.split()[3]) # 3 is the alpha channel 47 | return background 48 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/beginner-tutorial-yaxis-translation.rst: -------------------------------------------------------------------------------- 1 | Translating the y-axis 2 | ====================== 3 | To correctly reproduce the diagram data, there are now only to more things to 4 | know, that is the scaling of the y- and x-axes in the diagram. 5 | 6 | 1. Expand the `Axes translations` tab in the digitization control 7 | 2. Click the :guilabel:`Insert Y-axis values` button in the `Axes translations` 8 | section of the straditizer control 9 | 3. Shift-leftclick on the plot to enter the corresponding y-value. 10 | 11 | .. image:: select-y0_1.png 12 | 13 | 4. A small dialog will appear where you should enter the y-value to use (in 14 | this case, ``300``) 15 | 16 | .. image:: select-y0_2.png 17 | 18 | 5. After hitting the :guilabel:`Ok` button, you will see a mark on the plot 19 | (blue line). You can select the mark via leftclick and drag it to a 20 | different location or you can delete it via rightclick. 21 | 22 | .. image:: select-y0_3.png 23 | 24 | 6. now repeat steps 2-4 on a second point on the y-axis 25 | 26 | - Select another point 27 | 28 | .. image:: select-y1_1.png 29 | 30 | - Enter the corresponding value (here ``350``) 31 | 32 | .. image:: select-y1_2.png 33 | 34 | - A new mark is created that you can modify 35 | 36 | .. image:: select-y1_3.png 37 | 38 | 7. Click the :guilabel:`Apply` button at the bottom of the straditizer control 39 | when you are done. 40 | 41 | .. note:: 42 | 43 | If you drag a mark and hold the :kbd:`Shift` button while releasing the 44 | mouse button, the dialog in point 3 from above will not pop up. 45 | -------------------------------------------------------------------------------- /tests/widgets/test_command_line.py: -------------------------------------------------------------------------------- 1 | """Test module for the command line implementation of straditize 2 | 3 | This module test :mod:`straditize.__main__`""" 4 | import _base_testing as bt 5 | import unittest 6 | import pandas as pd 7 | from straditize.__main__ import start_app, get_parser 8 | 9 | 10 | class CommandLineTest(bt.StraditizeWidgetsTestCase): 11 | """Test class for the command lines""" 12 | 13 | def test_open_image(self, *args, **kwargs): 14 | fname = self.get_fig_path('basic_diagram.png') 15 | old_window = self.window 16 | self.window = start_app(fname, exec_=False, new_instance=self.window, 17 | **kwargs) 18 | self.assertIs(self.window, old_window) 19 | self.init_reader() 20 | self.assertIsNotNone(self.straditizer) 21 | self.assertEqual(self.straditizer.get_attr('image_file'), fname, 22 | msg='Image not opened correctly!') 23 | 24 | def test_xlim_ylim(self, *args, **kwargs): 25 | return 26 | self.test_open_image(xlim=list(self.data_xlim), 27 | ylim=list(self.data_ylim)) 28 | self.assertIsNotNone(self.reader) 29 | 30 | def test_output(self): 31 | fname = self.get_fig_path('basic_diagram.png') 32 | temp_file = self.get_random_filename(suffix='.csv') 33 | parser = get_parser() 34 | cmd = fname + ' -ni -f -o ' + temp_file 35 | parser.parse_known2func(cmd.split()) 36 | df = pd.read_csv(temp_file, index_col=0) 37 | self.assertTrue(len(df)) 38 | 39 | 40 | if __name__ == '__main__': 41 | unittest.main() 42 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/beginner-tutorial-column-names.rst: -------------------------------------------------------------------------------- 1 | Column names 2 | ============ 3 | Finally, we select the column titles and save them in the project. 4 | 5 | Each of the sub diagrams has a title, in our case, *Pinus*, *Juniperus*, 6 | *Quercus ilex-type* and *Chenopodiaceae*. These names should be used in the 7 | final digitization result and therefore you can include them in straditize: 8 | 9 | 1. Expand the `Column names` item in the straditizer control and click the 10 | :guilabel:`Edit column names` button 11 | 2. In the appearing widget, the colnames editor 12 | 13 | .. image:: tutorial-colnames-editor.png 14 | :alt: column names editor 15 | 16 | you find a table where you can edit the column names. The plot on it's left 17 | also shows a rotated version of the diagram, to help you identifying the 18 | column names. You can navigate in this plot using leftclick and zoom in and 19 | out using right-click (see 20 | `matplotlibs docs on interactive navigation with the Pan/Zoom-tool`_). 21 | 22 | .. hint:: 23 | 24 | If you have tesserocr installed (see the :ref:`user manual `), 25 | you can also just click the :guilabel:`Find column names` button and you 26 | are done. 27 | 3. When you entered the correct names in the table (see image below), click the 28 | :guilabel:`Edit column names` button again to hide the dialog. 29 | 30 | .. image:: tutorial-colnames-editor-finished.png 31 | :alt: column names editor with names 32 | 33 | .. _matplotlibs docs on interactive navigation with the Pan/Zoom-tool: https://matplotlib.org/users/navigation_toolbar.html 34 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-tutorial-yaxis-translation.rst: -------------------------------------------------------------------------------- 1 | Translating the y-axis 2 | ====================== 3 | To correctly reproduce the diagram data, there are now only to more things to 4 | know, that is the scaling of the y- and x-axes in the diagram. 5 | 6 | 1. Expand the `Axes translations` tab in the digitization control 7 | 2. Click the :guilabel:`Insert Y-axis values` button in the `Axes translations` 8 | section of the straditizer control 9 | 3. Shift-leftclick on the plot to enter the corresponding y-value. 10 | 11 | .. image:: select-y0_1.png 12 | 13 | 4. A small dialog will appear where you should enter the y-value to use (in 14 | this case, ``300``) 15 | 16 | .. image:: select-y0_2.png 17 | 18 | 5. After hitting the :guilabel:`Ok` button, you will see a mark on the plot 19 | (blue line). You can select the mark via leftclick and drag it to a 20 | different location or you can delete it via rightclick. 21 | 22 | .. image:: select-y0_3.png 23 | 24 | 6. now repeat steps 2-4 on a second point on the y-axis 25 | 26 | - Select another point 27 | 28 | .. image:: select-y1_1.png 29 | 30 | - Enter the corresponding value (here ``350``) 31 | 32 | .. image:: select-y1_2.png 33 | 34 | - A new mark is created that you can modify 35 | 36 | .. image:: select-y1_3.png 37 | 38 | 7. Click the :guilabel:`Apply` button at the bottom of the straditizer control 39 | when you are done. 40 | 41 | .. note:: 42 | 43 | If you drag a mark and hold the :kbd:`Shift` button while releasing the 44 | mouse button, the dialog in point 3 from above will not pop up. 45 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/beginner-tutorial-clean-image.rst: -------------------------------------------------------------------------------- 1 | Cleaning the image 2 | ================== 3 | The next step is to clean the data image to make sure that everything that is 4 | not representing real data is removed. In our case, these are y-axes, x-axes 5 | and the outer frame. You can also use an external image editing software such 6 | as Adobe Photoshop, but we will do this now inside straditize and use some of 7 | the automatic recognition functionalities. 8 | 9 | 1. Expand the `Remove features` tab 10 | 2. Click the y-axes button, the y-axes in the plot will be highlighted 11 | 12 | .. image:: yaxes.png 13 | 3. Click `Remove` to remove them 14 | 4. 2. Click the x-axes button, the x-axes in the plot will be highlighted 15 | 16 | .. image:: xaxes.png 17 | 5. Click `Remove` to remove them 18 | 6. Finally there is the right part of the diagram frame left 19 | 20 | .. image:: right-line.png 21 | 22 | For this, we use the selection toolbar: 23 | 24 | i. from the |wand| menu, select the `column selection` tool (click and hold 25 | the button to the right of the |rect_select| button in the selection 26 | toolbar to open the menu) 27 | 28 | .. image:: column-selection-tool.png 29 | 30 | ii. Draw a rectangle around the right line 31 | 32 | .. image:: select-right.png 33 | 34 | and make sure you have the |new-select| mode activated 35 | 36 | iii. Click the `Remove` button when you are done 37 | 38 | 39 | .. |wand| image:: wand_select.png 40 | :width: 1.3em 41 | 42 | .. |rect_select| image:: select.png 43 | :width: 1.3em 44 | 45 | .. |new-select| image:: new_selection.png 46 | :width: 1.3em 47 | -------------------------------------------------------------------------------- /icon/icon.py: -------------------------------------------------------------------------------- 1 | """Create the psyplot icon 2 | 3 | This script creates the psyplot icon with a dpi of 128 and a width and height 4 | of 8 inches. The file is saved it to ``'icon1024.png'``""" 5 | import numpy as np 6 | import matplotlib.pyplot as plt 7 | import matplotlib.patches as mpatches 8 | import matplotlib.colors as mcol 9 | 10 | fig = plt.figure(figsize=(8, 8), dpi=128) 11 | 12 | ax = fig.add_axes([0.0, 0.0, 1.0, 1.0], facecolor='none') 13 | ax.axis('off') 14 | 15 | cmap = plt.get_cmap('binary') 16 | 17 | xlines = np.arange(0, 41, 5) 18 | nlines = len(xlines) 19 | 20 | colors = np.r_[cmap(np.linspace(0, 0.9, nlines // 2)), 21 | cmap(np.linspace(0, 0.9, nlines // 2))[::-1]] 22 | 23 | full_cmap = mcol.LinearSegmentedColormap.from_list('Reds_sedR', colors, 24 | nlines) 25 | 26 | x = np.array([ 27 | 2, 5, 1, 8, 0, 5, 0, 6, 1, 4, 7, 5, 1, 1, 5, 0, 4, 0, 6, 1, 4, 1, 5, 2, 6, 28 | 8, 5, 0, 3, 0, 6, 2, 1, 3, 2, 5, 7, 5, 4, 3]) 29 | 30 | for i in xlines: 31 | ax.plot(x + i, np.arange(len(x)), color=full_cmap(i/40.), lw=10.0) 32 | 33 | patch = mpatches.Circle((0.5, 0.5), radius=0.49, transform=ax.transAxes, 34 | facecolor='k', zorder=0.5) 35 | # the border of the circle 36 | border = mpatches.Circle((0.5, 0.5), radius=0.49, transform=ax.transAxes, 37 | facecolor='none', edgecolor='lightgray', linewidth=10, 38 | zorder=10) 39 | 40 | for l in ax.lines: 41 | l.set_clip_path(patch) 42 | 43 | ax.add_patch(patch) 44 | ax.add_patch(border) 45 | 46 | ax.set_xlim(0, 45) 47 | ax.set_ylim(2.5, 40) 48 | 49 | plt.savefig('icon1024.png', transparent=True) 50 | -------------------------------------------------------------------------------- /tests/test_straditizer.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | Test module for the :mod:`straditize.straditizer` module 4 | """ 5 | import six 6 | import os.path as osp 7 | import unittest 8 | from itertools import chain 9 | import numpy as np 10 | from straditize.straditizer import Straditizer 11 | import pandas as pd 12 | import create_test_sample as ct 13 | import matplotlib as mpl 14 | 15 | mpl.use('module://psyplot_gui.backend') 16 | 17 | 18 | test_dir = osp.dirname(__file__) 19 | 20 | 21 | class StraditizerTest(unittest.TestCase): 22 | """Test methods for the straditizer""" 23 | 24 | def test_format_coord(self): 25 | """Test the formatting of a coordinate""" 26 | stradi = Straditizer(osp.join(test_dir, 'test_figures', 27 | 'basic_diagram.png')) 28 | stradi.data_xlim = stradi.data_ylim = np.array([10, 30]) 29 | stradi.init_reader() 30 | stradi.data_reader._get_column_starts() 31 | ax = stradi.ax 32 | x, y = 11.0, 11.0 33 | ref = (stradi._orig_format_coord(x, y) + 34 | "DataReader: x=%s y=%sColumn 0 x=%s" % ( 35 | ax.format_xdata(1.), ax.format_ydata(1.), 36 | ax.format_xdata(1.))) 37 | self.assertEqual(ax.format_coord(x, y), ref) 38 | 39 | def test_guess_data_lims(self): 40 | stradi = Straditizer(osp.join(test_dir, 'test_figures', 41 | 'basic_diagram.png')) 42 | xlim, ylim = stradi.guess_data_lims() 43 | self.assertEqual(list(xlim), [10, 27]) 44 | self.assertEqual(list(ylim), [10, 30]) 45 | 46 | 47 | if __name__ == '__main__': 48 | unittest.main() 49 | -------------------------------------------------------------------------------- /straditize/widgets/docs/remove_disconnected_parts.rst: -------------------------------------------------------------------------------- 1 | .. _remove-disconnected: 2 | 3 | Remove disconnected features 4 | ============================ 5 | This function automatically recognizes features that are disconnected either 6 | from the column start or from the previous feature in the column. 7 | 8 | That can be useful, for example, to remove letters or symbols in the diagram. 9 | 10 | What features are recognized can be defined in three ways: 11 | 12 | 1. Features that have a certain distance from the column start (see 13 | :ref:`disco-from0` 14 | 2. Features that have a certain distance from the previous 15 | feature in the column (see :ref:`disco-fromlast`) 16 | 3. A combination of 1. and 2. (see :ref:`disco-both`) 17 | 18 | .. _disco-from0: 19 | 20 | Disconnected from the column start 21 | ---------------------------------- 22 | When only the checkbox *from column start* is checked, all features that 23 | have the given distance from the column start are selected. 24 | 25 | .. image:: basic_diagram_disconnected_01.png 26 | 27 | .. _disco-fromlast: 28 | 29 | Disconnected from the previous feature 30 | -------------------------------------- 31 | When only the checkbox *from previous feature* is selected, all features 32 | that have the given distance from the previous feature in the column (and 33 | everything to the right of it) is selected. 34 | 35 | .. image:: basic_diagram_disconnected_03.png 36 | 37 | .. _disco-both: 38 | 39 | Disconnected from start and previous 40 | ------------------------------------ 41 | If both are selected, the selected feature must have the given distance 42 | from the column start and from the previous feature in the column to be 43 | selected. 44 | 45 | .. image:: basic_diagram_disconnected_02.png 46 | -------------------------------------------------------------------------------- /tests/widgets/test_image_correction.py: -------------------------------------------------------------------------------- 1 | """Test module for :mod:`straditize.widgets.image_correction""" 2 | import _base_testing as bt 3 | import unittest 4 | from psyplot_gui.compat.qtcompat import QTest, Qt 5 | 6 | 7 | class ImageRotatorTest(bt.StraditizeWidgetsTestCase): 8 | """Test case for the 9 | :class:`straditize.widgets.image_correction.ImageRotator` class""" 10 | 11 | @property 12 | def rotator(self): 13 | return self.straditizer_widgets.image_rotator 14 | 15 | def test_horizontal_rotation(self): 16 | self.open_img() 17 | self.straditizer.draw_figure() 18 | self.rotator.start_horizontal_alignment() 19 | self.add_mark((10, 10), ax=self.straditizer.ax) 20 | self.add_mark((10, 30)) 21 | angle = self.rotator.angle 22 | self.assertEqual(angle, -90) 23 | rotated = self.straditizer.image.rotate(angle, expand=True) 24 | QTest.mouseClick(self.straditizer_widgets.apply_button, 25 | Qt.LeftButton) 26 | self.assertArrayEquals(self.straditizer.image, rotated) 27 | 28 | def test_vertical_rotation(self): 29 | self.open_img() 30 | self.straditizer.draw_figure() 31 | self.rotator.start_vertical_alignment() 32 | self.add_mark((10, 10), ax=self.straditizer.ax) 33 | self.add_mark((30, 10)) 34 | angle = self.rotator.angle 35 | self.assertEqual(angle, 90) 36 | rotated = self.straditizer.image.rotate(angle, expand=True) 37 | QTest.mouseClick(self.straditizer_widgets.apply_button, 38 | Qt.LeftButton) 39 | self.assertArrayEquals(self.straditizer.image, rotated) 40 | 41 | 42 | if __name__ == '__main__': 43 | unittest.main() 44 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | #### Screenshot 2 | 3 | [add screenshots of your problem] 4 | 5 | #### Files 6 | 7 | Upload the image file or your straditize project file that can be used to 8 | reproduce the problem. Try to have it as small and exact as possible, this will 9 | help assisting you with your problem. 10 | 11 | #### Problem description 12 | 13 | [this should explain **why** the current behavior is a problem and why the expected output is a better solution.] 14 | 15 | #### Expected Output 16 | What should have been expected? You can hide large error messages within ``
`` tags, e.g. 17 | 18 |
19 | very long error message 20 |
21 | 22 | #### Environment information 23 | 24 |
25 | psyplot -aV 26 | 27 | # Paste the output of the command ``psyplot -aV`` (ran from the command line) 28 | 29 |
30 | 31 |
32 | straditize -V 33 | 34 | # Paste the output of the command ``straditize -V`` (ran from the command line) 35 | 36 |
37 | 38 |
39 | conda info -a 40 | 41 | ``` 42 | # Paste the output of the command ``conda info -a`` (ran from the command line) 43 | ``` 44 |
45 | 46 |
47 | conda list 48 | 49 | ``` 50 | # Paste the output of the command ``conda list`` (ran from the command line) 51 | ``` 52 |
53 | 54 | #### NOTE 55 | This is a bug report. 56 | 57 | For requesting new features, use [this template](https://github.com/Chilipp/straditize/issues/new?template=new_feature.md&title=NEW+FEATURE:). 58 | 59 | For changing existing features, use [this template](https://github.com/Chilipp/straditize/issues/new?template=change_feature.md&title=CHANGE+FEATURE:). 60 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/beginner-tutorial-select-data.rst: -------------------------------------------------------------------------------- 1 | Select the diagram part 2 | ======================= 3 | The second step involves selecting the diagram part. This is the part where 4 | your data is displayed, but without the vertical and horizontal axes 5 | descriptions. 6 | 7 | .. image:: data-part.png 8 | 9 | Being exact in this step significantly reduces the later work and simplifies 10 | the automatic digitization. 11 | 12 | 1. Click the :guilabel:`Select data part` button in the digitization control. 13 | 2. Straditize automatically recognizes the data part. But you can change this 14 | by moving the crosses around with your mouse (see the note below). 15 | 3. Click the :guilabel:`Apply` button at the bottom 16 | 4. Done! You now see a red rectangle in your diagram the marks the data part. 17 | You can hide it using the `Plot control` section in the straditizer control. 18 | For the sake of this tutorial, expand the `Plot control` section and remove 19 | the rectangle by clicking the |invalid| icon for the `Diagram part` 20 | 21 | 22 | .. note:: 23 | 24 | These marks are very common in straditize. In general, you can 25 | left-click on a mark to move it around, right-click to delete it, and 26 | Shift+left-click on the plot to create a new one. 27 | 28 | Note that you need to disable the |pan| and |zoom| tools in the navigation 29 | to interact with the marks, by clicking on the corresponding button! 30 | 31 | If you want to change the appearance of the marks, see the `Marker control` 32 | section in the straditizer control panel. 33 | 34 | 35 | .. |invalid| image:: invalid.png 36 | :width: 1.3em 37 | 38 | .. |pan| image:: move_large.png 39 | :width: 1.3em 40 | 41 | .. |zoom| image:: zoom_to_rect_large.png 42 | :width: 1.3em 43 | -------------------------------------------------------------------------------- /straditize/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """Digitizing stratigraphic diagrams with straditize 3 | 4 | The core of straditize is the :class:`~straditize.straditizer.Straditizer` 5 | class and the reader for the diagram part, the 6 | :class:`~straditize.binary.DataReader`. Both classes work completely 7 | independent of the graphical user interace. 8 | 9 | The graphical user interface is implemented as a plugin into the 10 | :ref:`psyplot_gui:psyplot-gui` package and is implemented in the 11 | :mod:`straditize.widgets` subpackage. 12 | 13 | **Authors** 14 | 15 | The code and GUI of straditize was developed by Philipp S. Sommer at the 16 | Institute of Earth System Dynamics (IDYST) at the University of Lausanne as 17 | part of the SNF funded HORNET Project (200021_169598). 18 | 19 | The other contributors are Basil A. S. Davis, Manuel Chevalier and 20 | Dilan Rech who made significant contributions to the layout, workflow, beta 21 | tests and and reviewing of the software. 22 | 23 | **Disclaimer** 24 | 25 | Copyright (C) 2018-2019 Philipp S. Sommer 26 | 27 | This program is free software: you can redistribute it and/or modify 28 | it under the terms of the GNU General Public License as published by 29 | the Free Software Foundation, either version 3 of the License, or 30 | (at your option) any later version. 31 | 32 | This program is distributed in the hope that it will be useful, 33 | but WITHOUT ANY WARRANTY; without even the implied warranty of 34 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 35 | GNU General Public License for more details. 36 | 37 | You should have received a copy of the GNU General Public License 38 | along with this program. If not, see . 39 | """ 40 | from straditize.version import __version__ 41 | 42 | __author__ = "Philipp S. Sommer (philipp.sommer@unil.ch)" 43 | -------------------------------------------------------------------------------- /straditize/widgets/docs/yaxis_translation.rst: -------------------------------------------------------------------------------- 1 | .. _yaxis-translation: 2 | 3 | Translating the shared vertical axis 4 | ==================================== 5 | For your final product, straditize needs to know about how the data in the 6 | diagram is scaled, such that we can transform the final sample information from 7 | the pixel coordinates into the units of the diagram (e.g. years or meters in 8 | case of time or depth). 9 | 10 | To translate the y-axis information, 11 | 12 | 1. Expand the `Axes translations` tab in the digitization control 13 | 2. Click the :guilabel:`Insert Y-axis values` button in the `Axes translations` 14 | section of the straditizer control (if not already done) 15 | 3. Shift-leftclick on the plot to enter the corresponding y-value. 16 | 17 | .. image:: select-y0_1.png 18 | 19 | 4. A small dialog will appear where you should enter the y-value to use (in 20 | this case, ``300``) 21 | 22 | .. image:: select-y0_2.png 23 | 24 | 5. After hitting the :guilabel:`Ok` button, you will see a mark on the plot 25 | (blue line). You can select the mark via leftclick and drag it to a 26 | different location or you can delete it via rightclick. 27 | 28 | .. image:: select-y0_3.png 29 | 30 | 6. now repeat steps 2-4 on a second point on the y-axis 31 | 32 | - Select another point 33 | 34 | .. image:: select-y1_1.png 35 | 36 | - Enter the corresponding value (here ``350``) 37 | 38 | .. image:: select-y1_2.png 39 | 40 | - A new mark is created that you can modify 41 | 42 | .. image:: select-y1_3.png 43 | 44 | 7. Click the :guilabel:`Apply` button at the bottom of the straditizer control 45 | when you are done. 46 | 47 | .. note:: 48 | 49 | If you drag a mark and hold the :kbd:`Shift` button while releasing the 50 | mouse button, the dialog in point 3 from above will not pop up. 51 | -------------------------------------------------------------------------------- /docs/about.rst: -------------------------------------------------------------------------------- 1 | .. _about: 2 | 3 | About straditize 4 | ================ 5 | 6 | Why straditize? 7 | --------------- 8 | In an age of digital data analysis, gaining access to data from the pre-digital 9 | era – or any data that is only available as a figure on a page – remains a 10 | problem and an under-utilized scientific resource. Whilst there are numerous 11 | programs available that allow the digitization of scientific data in a simple 12 | x-y graph format, we know of no semi-automated program that can deal with data 13 | plotted with multiple horizontal axes that share the same vertical axis, such 14 | as pollen diagrams and other stratigraphic figures that are common in the Earth 15 | sciences. STRADITIZE (Stratigraphic Diagram Digitizer) is a new open-source 16 | program that allows stratigraphic figures to be digitized in a single semi- 17 | automated operation. It is designed to detect multiple plots of variables 18 | analyzed along the same vertical axis, whether this is a sediment core or any 19 | similar depth/time series. 20 | 21 | 22 | About the author 23 | ---------------- 24 | The code and GUI of straditize was developed by Philipp S. Sommer at the 25 | Institute of Earth System Dynamics (IDYST) at the University of Lausanne as 26 | part of the SNF funded HORNET_ Project (200021_169598). 27 | 28 | The other contributors are `Basil A. S. Davis`_, `Manuel Chevalier`_ and 29 | Dilan Rech who made significant contributions to the layout, workflow, beta 30 | tests and and reviewing of the software. 31 | 32 | .. _HORNET: http://p3.snf.ch/project-169598 33 | .. _Basil A. S. Davis: https://www.researchgate.net/profile/Basil_Davis 34 | .. _Manuel Chevalier: https://chevaliermanuel.wixsite.com/webpage 35 | 36 | License 37 | ------- 38 | straditize is published under the 39 | `GNU General Public License v3.0 `__ 40 | under the copyright of Philipp S. Sommer, 2018-2019 41 | -------------------------------------------------------------------------------- /straditize/widgets/docs/select_reader.rst: -------------------------------------------------------------------------------- 1 | .. _select-reader: 2 | 3 | Selecting the reader 4 | ==================== 5 | Stratigraphic diagrams and especially pollen diagrams come in different styles 6 | and formats. 7 | 8 | Straditize supports the following: 9 | 10 | +---------------------+---------------------+---------------------+ 11 | | **area** | **bars** | **rounded bars** | 12 | +---------------------+---------------------+---------------------+ 13 | | |area| | |bars| | |rounded bars| | 14 | +=====================+=====================+=====================+ 15 | | **line** | **stacked area** | | 16 | +---------------------+---------------------+---------------------+ 17 | | |line| | |stacked| | | 18 | +---------------------+---------------------+---------------------+ 19 | 20 | For each type there exists a specific reader that you can select from the 21 | drop down menu in the `Reader initialization` section of the straditizer 22 | control. If you're diagram contains a mixture of types, just choose one type 23 | for now and you can then later 24 | :ref:`create column specific readers `. 25 | 26 | After you chose the :ref:`diagram part ` and selected the 27 | reader type (see the table above), you can now click the 28 | :guilabel:`Convert image` button. This initializes the reader and converts the 29 | data image to a binary image, i.e. black and white. 30 | 31 | Everything that is black in this image will be considered as data by the 32 | reader. So the next steps will include, cleaning up the image and removing 33 | unimportant parts. 34 | 35 | 36 | .. |area| image:: area-diagram.png 37 | 38 | .. |bars| image:: bar-diagram.png 39 | 40 | .. |rounded bars| image:: rounded-bar-diagram.png 41 | 42 | .. |line| image:: line-diagram.png 43 | 44 | .. |stacked| image:: stacked-diagram.png 45 | -------------------------------------------------------------------------------- /tests/widgets/test_straditizer_widgets.py: -------------------------------------------------------------------------------- 1 | """Test module for the :mod:`straditizer.widgets` module""" 2 | import _base_testing as bt 3 | import unittest 4 | import numpy as np 5 | 6 | 7 | class StraditizerWidgetsTest(bt.StraditizeWidgetsTestCase): 8 | """Test case for the :class:`straditizer.widgets.StraditizerWidgets`""" 9 | 10 | def test_edit_attrs(self): 11 | """Test editing the attributes""" 12 | self.open_img() 13 | n = len(self.window.dataframeeditors) 14 | editor, combo = self.straditizer_widgets.edit_attrs() 15 | self.assertEqual(len(self.window.dataframeeditors), n+1) 16 | combo.addItem('latitude') 17 | combo.setCurrentText('latitude') 18 | self.assertIn('latitude', self.straditizer.attrs.index) 19 | 20 | def test_create_straditizer_from_args_01(self): 21 | fname = self.get_fig_path('basic_diagram.png') 22 | xlim = np.array([9, 30]) 23 | ylim = np.array([10, 30]) 24 | self.straditizer_widgets.create_straditizer_from_args( 25 | [fname], 26 | None, # project 27 | xlim, ylim, 28 | False, # full 29 | 'area' # reader_type 30 | ) 31 | self.assertIsNotNone(self.straditizer) 32 | self.assertEqual(list(self.straditizer.data_xlim), list(xlim)) 33 | self.assertEqual(list(self.straditizer.data_ylim), list(ylim)) 34 | 35 | def test_create_straditizer_from_args_02(self): 36 | fname = self.get_fig_path('basic_diagram.png') 37 | self.straditizer_widgets.create_straditizer_from_args( 38 | [fname], 39 | None, # project 40 | None, None, # xlim, ylim 41 | True, # full 42 | 'area' # reader_type 43 | ) 44 | self.assertIsNotNone(self.straditizer) 45 | self.assertEqual(list(self.straditizer.data_xlim), [0, 40]) 46 | self.assertEqual(list(self.straditizer.data_ylim), [0, 40]) 47 | 48 | 49 | if __name__ == '__main__': 50 | unittest.main() 51 | -------------------------------------------------------------------------------- /straditize/widgets/docs/occurences.rst: -------------------------------------------------------------------------------- 1 | .. _occurences: 2 | 3 | Select occurences 4 | ================= 5 | Pollen diagrams often mark low taxon percentages to highlight the occurence 6 | of a taxon, such as the ``+`` in the image below 7 | 8 | .. image:: occurences.png 9 | :alt: plot of taxon occurence 10 | 11 | This is very useful information which can be considered by straditize. 12 | 13 | 1. Expand the *Occurences* tab in the *Digitization control* section 14 | 2. Click the :guilabel:`Select occurences` button and select the occurences 15 | using the tools from the :ref:`selection toolbar `, 16 | especially the |select-pattern| tool is useful 17 | 18 | .. image:: selected-occurences.png 19 | :alt: selected occurences 20 | 21 | 3. Click the :guilabel:`Apply button` and the selected features in the diagram 22 | will be registered as an *occurence*. If you also checked the 23 | `Remove on apply` checkbox next the to :guilabel:`Select occurences` button 24 | (which you normally should), the selected features in the diagram will be 25 | removed, too and you will end up with a plot like this 26 | 27 | .. image:: removed-occurences.png 28 | :alt: removed occurences 29 | 30 | 4. You can see and edit the occurences using the :guilabel:`Edit occurences` 31 | button. This will create horizontal markers at the positions of the original 32 | occurences 33 | 34 | .. image:: edit-occurences.png 35 | :alt: Editing of occurences 36 | 37 | In our demonstration, straditize could not distinguish two of the occurence 38 | markers because they were too close to each other. But you can just move the 39 | mark with Left-click and Shift+Leftclick on the plot to create a new marker 40 | 41 | .. image:: edited-occurences.png 42 | :alt: Edited occurences 43 | 44 | Click the :guilabel:`Apply` button when you are done. 45 | 46 | 5. The marked occurences will appear later in the final data frame with the 47 | specified *Occurence value*. 48 | 49 | .. |select-pattern| image:: pattern.png 50 | :width: 1.3em 51 | -------------------------------------------------------------------------------- /straditize/widgets/docs/xaxis_translation.rst: -------------------------------------------------------------------------------- 1 | .. _xaxis-translation: 2 | 3 | Translating the horizontal axes 4 | =============================== 5 | For your final product, straditize needs to know about how the data in the 6 | diagram is scaled, such that we can transform the final sample information from 7 | the pixel coordinates into the units of the diagram (e.g. percent for pollen 8 | data or Kelvin for temperature, etc.). 9 | 10 | To translate the x-axis information, 11 | 12 | 1. Expand the `Axes translations` tab in the digitization control 13 | 2. Click the :guilabel:`Insert X-axis values` button in the `Axes translations` 14 | section of the straditizer control (if not already done) 15 | 3. Shift-leftclick on the plot in one of the columns to enter the corresponding 16 | x-value. 17 | 18 | .. image:: select-x0_1.png 19 | 20 | 4. A small dialog will appear where you should enter the x-value to use (in 21 | this case, ``10``) 22 | 23 | .. image:: select-x0_2.png 24 | 25 | 5. After hitting the :guilabel:`Ok` button, you will see a mark on the plot 26 | (blue line). You can select the mark via leftclick and drag it to a 27 | different location or you can delete it via rightclick. 28 | 29 | .. image:: select-x0_3.png 30 | 31 | 6. now repeat steps 3-5 on a second point in the same column 32 | 33 | - Select another point 34 | 35 | .. image:: select-x1_1.png 36 | 37 | - Enter the corresponding value (here ``30``) 38 | 39 | .. image:: select-x1_2.png 40 | 41 | - A new mark is created that you can modify 42 | 43 | .. image:: select-x1_3.png 44 | 45 | 7. Click the :guilabel:`Apply` button at the bottom of the straditizer control 46 | when you are done. 47 | 48 | .. note:: 49 | 50 | If you have different units or different scalings in the diagram, create 51 | :ref:`column specific readers ` and translate the x-axis 52 | separately for each reader/column. 53 | 54 | .. note:: 55 | 56 | If you drag a mark and hold the :kbd:`Shift` button while releasing the 57 | mouse button, the dialog in point 3 from above will not pop up. 58 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/beginner-tutorial-control.rst: -------------------------------------------------------------------------------- 1 | The straditize workflow 2 | ======================= 3 | 4 | The straditize workflow, i.e. the program for the next few minutes consists of 5 | 6 main steps: 6 | 7 | 1. Load the diagram 8 | 2. Select the diagram part (withouth x-axes labels, y-axes labels, etc.) 9 | 3. Clean the diagram part. Only the data parts should be left over, i.e. no 10 | y-axes, lines, letters, etc. 11 | 4. Digitize the diagram 12 | 5. Find and edit the samples 13 | 6. Export the data to Excel or CSV 14 | 15 | Most of these tasks can be done in an automatic way but you should always 16 | review and edit the outcome to make sure that what you do is scientifically 17 | reliable. 18 | 19 | The interface to these semi-automatic steps is the straditizer control 20 | 21 | .. figure:: straditizer-control-cut.png 22 | :target: _static/straditizer-control.png 23 | 24 | Click the image to enlarge it 25 | 26 | You can expand the submenus using the |arrow| buttons in the control and you 27 | can access the user manual using the |info| buttons on the right side. 28 | 29 | Before we start with the diagram, we will highlight some of the sections in the 30 | GUI: 31 | 32 | The ToDo list 33 | The list at the top of the control guides you through the 34 | *straditization* process. It shows the open tasks you should consider. 35 | 36 | Most of them will be marked as done automatically, but if you think you are 37 | done with one of the tasks, just right-click the task and mark it as done. 38 | The Plot control 39 | This section at the bottom of the control gives you some visual 40 | explorations of your diagram and the digitization process. You should, 41 | whenever possible, use it's functionalities, most of the errors can be 42 | spotted visually 43 | The Help explorer 44 | This separate widgets can be used to access the user manual and provides 45 | guidance for the different functionalities. This should always be your 46 | first point of reference if you have any problems. 47 | 48 | 49 | .. |arrow| image:: control-arrow.png 50 | :height: 1em 51 | 52 | .. |info| image:: info.png 53 | :width: 1.3em 54 | -------------------------------------------------------------------------------- /straditize/widgets/docs/save_and_load.rst: -------------------------------------------------------------------------------- 1 | .. _save-and-load: 2 | 3 | Saving and loading your project 4 | =============================== 5 | 6 | .. _save: 7 | 8 | Saving a project 9 | ---------------- 10 | You can always save your current state to your hard-disc and continue working 11 | at it at a later point. To save a project, click 12 | :menuselection:`File --> Save --> Save straditizer` 13 | 14 | .. image:: save-project.png 15 | 16 | .. only:: html 17 | 18 | or hit :kbd:`Control-S` (:kbd:`⌘-S` on MacOS) 19 | 20 | .. only:: not html 21 | 22 | or hit :kbd:`Control-S` (:kbd:`Command-S` on MacOS). 23 | 24 | This will save your project, or, if you never saved it before or used the 25 | `Save As` option, it will open a file dialog to let you select the target 26 | location. 27 | 28 | The default and recommended way is to save it is a netCDF_ file (ending with 29 | ``.nc`` or ``.nc4``). This is a common self-describing, machine-independent 30 | data format that supports the creation, access, and sharing of array-oriented 31 | scientific data. We recommend this format, because it works independent of the 32 | python libraries that you are using and let's you easily share the project with 33 | others or copy it to another machine. 34 | 35 | The other possibility is to save it as a pickle (``.pkl``) file which uses the 36 | built-in :mod:`pickle` module to save the straditizer to a file. The reason, 37 | why we generally do not recomment this, is because the saved file might not 38 | work anymore if you upgrade your libraries (e.g. ``numpy``, ``pandas`` or 39 | ``pillow``). 40 | 41 | .. _netCDF: https://en.wikipedia.org/wiki/NetCDF 42 | 43 | .. _load: 44 | 45 | Loading a project 46 | ----------------- 47 | Reloading the project works the same way as you open a new image file (see 48 | :ref:`load_image`). Just go to 49 | :menuselection:`File --> Open project --> Open straditizer --> Project or image` 50 | and choose the project file to load (or use the |arrow| button at the top of the 51 | straditizer control). If the chosen file ends with ``.nc``, ``.nc4`` or 52 | ``.pkl``, straditize will recreate the given project. 53 | 54 | .. |arrow| image:: run_arrow.png 55 | :width: 1.3em 56 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-tutorial-remove-lines.rst: -------------------------------------------------------------------------------- 1 | Remove artifacts 2 | ================ 3 | Stratigraphic diagrams, and especially pollen diagrams, often have a lot of 4 | artifacts in it, that are informative for the reader. 5 | 6 | In our case, the diagram is splitted into three temporal *zones* (HDC-2, HDC-3 7 | and HDC-4, see the *Zone* column on the right part of the diagram) which are 8 | visually separated with horizontal lines. Additionally, the diagram has 9 | vertical, dashed lines at each column start (the y-axes for each column). 10 | 11 | Before we digitize our diagram, those *informative features* have to be 12 | removed. You can do this in an external image editing software (e.g. 13 | Photoshop) but we also implemented several automated algorithms to detect 14 | common features and remove them easily. 15 | 16 | For our tutorial, we use the *Remove lines* feature to detect and remove the 17 | vertical and horizontal lines. 18 | 19 | Horizontal lines 20 | ---------------- 21 | 22 | 1. Expand the *Remove features* tab in the *Digitization control* 23 | 2. Expand the item with the :guilabel:`vertical lines` and 24 | :guilabel:`horizontal lines` button by clicking on the small arrow on their 25 | left 26 | 3. Set the minimum line width to 1 pixel 27 | 4. Click the :guilabel:`horizontal lines` button. In the plot you will see, 28 | that the horizontal lines are red now (if necessary, go with the mouse over 29 | the plot and you will see it in the zoom window). You could edit the 30 | selection now using the selection toolbar (see :ref:`selection-toolbar`), 31 | but for our tutorial, this is not necessary. 32 | 5. Click the :guilabel:`Remove` button to remove the lines 33 | 34 | Vertical lines (y-axes) 35 | ----------------------- 36 | 37 | 1. Enable the maximum line width and set it to 2 pixel 38 | 2. Set the minimum fraction to 30% 39 | 3. Click the :guilabel:`vertical lines` button and the vertical lines turn 40 | red and are marked to be removed. 41 | 4. Click the :guilabel:`Remove` button to remove the y-axes 42 | 43 | Additional automated removal tools are available and fully described in the 44 | documentation (see :ref:`remove-features`). But here, we can continue 45 | with the digitization. 46 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/beginner-tutorial-intro.rst: -------------------------------------------------------------------------------- 1 | .. _beginner-tutorial: 2 | 3 | Beginners tutorial to introduce straditize 4 | ========================================== 5 | 6 | .. image:: beginner-tutorial.png 7 | 8 | In this tutorial, we digitize a simple small pollen diagram a subset of the 9 | Hoya del Castillo dataset from [Basil2007a]_. This tutorial will introduce you 10 | into the main parts of straditize and the basic workflow. 11 | 12 | At the bottom of the straditizer control, you find a navigation panel which 13 | helps you to navigate through the tutorial. Click the :guilabel:`Next` button 14 | in this control to start the tutorial. You can skip steps by clicking the 15 | :guilabel:`Skip` button and you can check what you have done using the 16 | :guilabel:`Check` button and then proceed with the next step. 17 | 18 | The tutorial will take between 5 and 10 minutes. You can save your current 19 | state to a file using :menuselection:`File --> Save --> Save straditizer` 20 | (see :ref:`save-and-load`) and reload it later via 21 | :menuselection:`File --> Open project --> Open straditizer --> Project or image` 22 | 23 | If you have questions or troubles with this tutorial, please open an issue on 24 | 25 | https://github.com/Chilipp/straditize/issues 26 | 27 | and we will do our best to assist you. 28 | 29 | .. toctree:: 30 | :numbered: 1 31 | :hidden: 32 | 33 | beginner-tutorial-control.rst 34 | beginner-tutorial-load-image 35 | beginner-tutorial-plot-navigation 36 | beginner-tutorial-select-data 37 | beginner-tutorial-create-reader 38 | beginner-tutorial-column-starts 39 | beginner-tutorial-clean-image 40 | beginner-tutorial-digitize 41 | beginner-tutorial-samples 42 | beginner-tutorial-yaxis-translation 43 | beginner-tutorial-xaxis-translation 44 | beginner-tutorial-column-names 45 | beginner-tutorial-finish 46 | 47 | 48 | References 49 | ---------- 50 | .. [Basil2007a] Davis, Basil A. S., and A. C. Stevenson. "The 8.2ka Event and 51 | Early-Mid Holocene Forests, Fires and Flooding in the Central Ebro Desert, 52 | NE Spain." Quat. Sci. Rev. , vol. 26, no. 13-14, 2007, pp. 1695-712, 53 | `doi:10.1016/j.quascirev.2007.04.007 `__. 54 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | # This file was generated automatically from conda-smithy. To update this configuration, 2 | # update the conda-forge.yml and/or the recipe/meta.yaml. 3 | # -*- mode: yaml -*- 4 | 5 | version: 2 6 | 7 | jobs: 8 | build_conda: 9 | working_directory: ~/test 10 | machine: true 11 | steps: 12 | - checkout 13 | - run: 14 | name: install apt requirements 15 | command: | 16 | sudo apt-get update 17 | sudo apt-get install libgl1-mesa-glx libegl1-mesa-dev 18 | - run: 19 | name: Install conda 20 | command: | 21 | echo "" 22 | echo "Installing a fresh version of Miniconda." 23 | MINICONDA_URL="https://repo.continuum.io/miniconda" 24 | MINICONDA_FILE="Miniconda3-latest-Linux-x86_64.sh" 25 | curl -L -O "${MINICONDA_URL}/${MINICONDA_FILE}" 26 | bash $MINICONDA_FILE -bp $HOME/miniconda3 27 | - run: 28 | name: Configure 29 | command: | 30 | echo "" 31 | source $HOME/miniconda3/bin/activate root 32 | echo "Configuring conda." 33 | conda config --set always_yes yes --set changeps1 no 34 | conda config --add channels conda-forge 35 | conda config --add channels chilipp 36 | conda config --add channels chilipp/label/master 37 | conda config --add channels chilipp/label/dev 38 | conda update -q conda 39 | conda install conda-build anaconda-client 40 | echo "backend : module://psyplot_gui.backend" > matplotlibrc 41 | export MATPLOTLIBRC=`pwd`/matplotlibrc 42 | export PYTHONWARNINGS='ignore:mode:DeprecationWarning:docutils.io:245' 43 | - run: 44 | name: Environment info 45 | command: | 46 | source $HOME/miniconda3/bin/activate root 47 | conda info -a 48 | conda list 49 | - run: 50 | # Run, test and (if we have a BINSTAR_TOKEN) upload the distributions. 51 | name: Test 52 | command: | 53 | source $HOME/miniconda3/bin/activate root 54 | conda build conda-recipe --python 3.7; 55 | 56 | workflows: 57 | version: 2 58 | build_and_test: 59 | jobs: 60 | - build_conda 61 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-tutorial-intro.rst: -------------------------------------------------------------------------------- 1 | .. _area-tutorial: 2 | 3 | Advanced tutorial: The Hoya del Castillo pollen diagram 4 | ======================================================= 5 | 6 | .. image:: hoya-del-castillo.png 7 | 8 | In this tutorial, we digitize a stratigraphic diagram based on the data in 9 | [Basil2007]_ and introduce to you how to extract the samples out of an area 10 | diagram. 11 | 12 | At the bottom of the straditizer control, you find a navigation panel which 13 | helps you to navigate through the tutorial. Click the :guilabel:`Next` button 14 | in this control to start the tutorial. You can skip steps by clicking the 15 | :guilabel:`Skip` button and you can check what you have done using the 16 | :guilabel:`Check` button and then proceed with the next step. 17 | 18 | The tutorial will take between 15 and 30 minutes. You can save your current 19 | state to a file using :menuselection:`File --> Save --> Save straditizer` 20 | (see :ref:`save-and-load`) and reload it later via 21 | :menuselection:`File --> Open project --> Open straditizer --> Project or image` 22 | 23 | If you have questions or troubles with this tutorial, please open an issue on 24 | 25 | https://github.com/Chilipp/straditize/issues 26 | 27 | and we will do our best to assist you. 28 | 29 | .. toctree:: 30 | :numbered: 1 31 | :hidden: 32 | 33 | hoya-del-castillo-tutorial-load-image 34 | hoya-del-castillo-tutorial-select-data 35 | hoya-del-castillo-tutorial-create-reader 36 | hoya-del-castillo-tutorial-column-starts 37 | hoya-del-castillo-tutorial-column-names-ocr 38 | hoya-del-castillo-tutorial-remove-lines 39 | hoya-del-castillo-tutorial-digitize 40 | hoya-del-castillo-tutorial-samples 41 | hoya-del-castillo-tutorial-yaxis-translation 42 | hoya-del-castillo-tutorial-xaxis-translation 43 | hoya-del-castillo-tutorial-meta 44 | hoya-del-castillo-tutorial-finish 45 | 46 | 47 | References 48 | ---------- 49 | .. [Basil2007] Davis, Basil A. S., and A. C. Stevenson. "The 8.2ka Event and 50 | Early-Mid Holocene Forests, Fires and Flooding in the Central Ebro Desert, 51 | NE Spain." Quat. Sci. Rev. , vol. 26, no. 13-14, 2007, pp. 1695-712, 52 | `doi:10.1016/j.quascirev.2007.04.007 `__. 53 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-tutorial-column-names-ocr.rst: -------------------------------------------------------------------------------- 1 | Specifying the column names 2 | =========================== 3 | Straditize can handle column names which will then be included in the final 4 | export. It interfaces with the tesserocr_ package and we will use this to 5 | minimize our typing amount. However, we have a complex diagram so manual 6 | corrections are unavoidable. 7 | 8 | 1. Expand the `Column names` item in the straditizer control and click the 9 | :guilabel:`Edit column names` button. 10 | 11 | In the appearing widget, the colnames editor 12 | 13 | .. image:: colnames-editor.png 14 | :alt: column names editor 15 | 16 | you find a table where you can edit the column names. The plot on it's left 17 | also shows a rotated version of the diagram, to help you identifying the 18 | column names. You can navigate in this plot using leftclick and zoom in and 19 | out using right-click (see 20 | `matplotlibs docs on interactive navigation with the Pan/Zoom-tool`_) 21 | 2. To improve the text recognition, it is highly recommended to have a clean 22 | image with only the column names on it and a sufficient resolution. We have 23 | something prepared for you: 24 | 25 | .. image:: hoya-del-castillo-colnames.png 26 | :alt: HR column names image 27 | 28 | Click the :guilabel:`Load HR image` button and select the 29 | `hoya-del-castillo-colnames.png` image file. 30 | 3. We will now use the automatic finding of column names. For this, 31 | click the :guilabel:`Find column names` button. This will search for the 32 | column names in the plot to the left of the table 33 | 4. There will probably be some errors in the column names. Therefore, go 34 | through each row in the table and check the name. You can use the 35 | :guilabel:`Hint` button to help you and/or zoom to the column name to see 36 | the name in the original 37 | 38 | .. image:: colnames-editor-zoomed.png 39 | :alt: Zoomed in column names editor 40 | 41 | 5. When you entered the correct names in the table, click the 42 | :guilabel:`Edit column names` button again to hide the button. 43 | 44 | .. _tesserocr: https://pypi.org/project/tesserocr/ 45 | .. _matplotlibs docs on interactive navigation with the Pan/Zoom-tool: https://matplotlib.org/users/navigation_toolbar.html)) 46 | -------------------------------------------------------------------------------- /straditize/widgets/docs/exaggerations.rst: -------------------------------------------------------------------------------- 1 | .. _exaggerations: 2 | 3 | Interpreting exaggerations 4 | ========================== 5 | Visualizing an exaggerated version of the data is a common methodology in 6 | pollen diagrams, since even small pollen counts can say a lot about the 7 | environment. 8 | 9 | Therefore it is common to not only plot the data, but also to exaggerate it 10 | by a certain factor, e.g. 10 or two like the red areas in the image below. 11 | 12 | .. image:: basic_diagram_exaggerated.png 13 | :width: 50% 14 | 15 | You have two choices: Either you remove these exaggerated areas 16 | (see :ref:`remove-features`), or you merge them into your results to improve 17 | the digitization result. 18 | 19 | To include and interprete the exaggerations, straditize can create a new reader 20 | dedicated for the exaggerations which you then have to select and specify when 21 | they should be used. This is all done in the `Exaggerations` tab of your 22 | digitization control. 23 | 24 | 1. Specify the `exaggeration factor`. This number is usually described in the 25 | caption of your diagram and must be greater than 1. 26 | 2. Select the data reader type for the exaggerations (see 27 | :ref:`select-reader`). Most common this is one of `area` or `line`. 28 | 3. Initialize the reader for the exaggerations by clicking :guilabel:`+`. You 29 | will now find a new reader dedicated to the exaggerations in the dropdown 30 | menu of the `Current reader` tab. But for now, we stick with the original 31 | one. 32 | 4. Now, you then have to select the exaggerations. Click the 33 | :guilabel:`Select exaggerations` button and use the tools in the 34 | :ref:`selection toolbar ` for selecting the features in 35 | the diagram that represent the exaggerations. When you're done with this, 36 | click the :guilabel:`Select` button. You can also repeat this step to select 37 | more and more features. 38 | 5. Specify when the exaggerations should be used. This can be either where the 39 | unexaggerated data is below a certain percentage of the image width and/or 40 | below a certain number of pixels. 41 | 6. When you now click the :guilabel:`Digitize exaggerations` button (but after 42 | you clicked the :guilabel:`Digitize` button for the original reader), the 43 | exaggerations will be digitized and merged into the digitization result of 44 | the non-exaggerated reader. 45 | -------------------------------------------------------------------------------- /straditize/widgets/docs/plot_control.rst: -------------------------------------------------------------------------------- 1 | .. _plot-control: 2 | 3 | Visualize your progress with the plot control 4 | ============================================= 5 | To explore and validate your digitization, straditize implements multiple 6 | ways to visualize the results. You can show and remove these static 7 | visualizations using the items in the plot control. 8 | 9 | Here you can hide the several plot objects using the :guilabel:`Visible` 10 | checkbox or you can plot the objects by clicking the |plot| button or remove 11 | it by clicking the |remove| button. 12 | 13 | .. note:: 14 | 15 | Please note, that these are static plots. So if you change your data, e.g. 16 | through modifying the column starts, you have to remove (|remove|) and 17 | plot (|plot|) the `Column starts` item to visualize the changes. 18 | 19 | .. image:: plot-control.png 20 | 21 | Some of the plotting features only visualize the currently selected columns. 22 | So if you have :ref:`column-specific readers ` or 23 | :ref:`exaggerations `, these options hide and show the plots for 24 | the currently selected columns only. 25 | 26 | Full image: 27 | The full image is the diagram, that you are digitizing 28 | Reader color image: 29 | This is the diagram part of the currently selected columns in color. 30 | Data background: 31 | This is just a white layer that lies over the `Full image` in the diagram 32 | part. If you want to see the diagram part in the `Full image`, you have 33 | to hide this layer 34 | Binary image: 35 | This is the image that is used to digitize the diagram part. As with the 36 | `Reader color image`, this option shows/hides the binary image for the 37 | currently selected columns. 38 | Diagram part: 39 | This draws a red rectangle around the `diagram part` (see the 40 | :ref:`terminology`) 41 | Column starts: 42 | Red lines showing you, where each column starts of out of the currently 43 | selected columns starts 44 | Full digitized data: 45 | After having hit the :guilabel:`Digitize` button, you can visualize the 46 | full digitized data for the currently selected columns. 47 | Potential samples: 48 | For each column, we identify rough locations where samples may lie (see 49 | :ref:`find-samples`). This plot option lets you visualize these. 50 | Samples: 51 | This option draws horizontal lines to show, the sample locations 52 | Reconstruction: 53 | This plot option draws one line for each column, as the 54 | `Full digitized data` does, but it uses only the x- and y-values at the 55 | sample locations. 56 | 57 | .. |plot| image:: valid.png 58 | :width: 1.3em 59 | 60 | .. |remove| image:: invalid.png 61 | :width: 1.3em 62 | -------------------------------------------------------------------------------- /tests/conftest.py: -------------------------------------------------------------------------------- 1 | """Configuration module for running tests with pytest 2 | 3 | We use a methodology inspired by 4 | https://nvbn.github.io/2017/02/02/pytest-leaking/ 5 | to show huw many MB are leaked from each test.""" 6 | import os 7 | from psutil import Process 8 | from collections import namedtuple 9 | from itertools import groupby 10 | 11 | # import skimage now to avoid 12 | # ImportError: dlopen: cannot load any more object with static TLS 13 | from skimage.feature import match_template 14 | 15 | 16 | _proc = Process(os.getpid()) 17 | 18 | 19 | def get_consumed_ram(): 20 | return _proc.memory_info().rss 21 | 22 | 23 | def pytest_addoption(parser): 24 | group = parser.getgroup("straditize", "straditize specific options") 25 | group.addoption('--nrandom', 26 | help='Set the number of generated random samples', 27 | default=2, type=int) 28 | group.addoption('--leak-threshold', help="Threshold for leak report", 29 | default=20, type=int) 30 | group.addoption( 31 | '--sort-leaks', help="Sort the leaking report in ascending order", 32 | action='store_true') 33 | 34 | 35 | def pytest_configure(config): 36 | import test_binary 37 | global LEAK_LIMIT, SORT_LEAKS 38 | test_binary.DataReaderTest.nsamples = config.getoption('nrandom') 39 | LEAK_LIMIT = config.getoption('leak_threshold') * 1024 * 1024 40 | SORT_LEAKS = config.getoption('sort_leaks') 41 | 42 | 43 | START = 'START' 44 | END = 'END' 45 | ConsumedRamLogEntry = namedtuple('ConsumedRamLogEntry', 46 | ('nodeid', 'on', 'consumed_ram')) 47 | consumed_ram_log = [] 48 | 49 | 50 | def pytest_runtest_setup(item): 51 | log_entry = ConsumedRamLogEntry(item.nodeid, START, get_consumed_ram()) 52 | consumed_ram_log.append(log_entry) 53 | 54 | 55 | def pytest_runtest_teardown(item): 56 | log_entry = ConsumedRamLogEntry(item.nodeid, END, get_consumed_ram()) 57 | consumed_ram_log.append(log_entry) 58 | 59 | 60 | # display leaks greater than 20 MB 61 | LEAK_LIMIT = 20 * 1024 * 1024 62 | 63 | SORT_LEAKS = False 64 | 65 | 66 | def pytest_terminal_summary(terminalreporter): 67 | grouped = groupby(consumed_ram_log, lambda entry: entry.nodeid) 68 | leaks = [] 69 | for nodeid, (start_entry, end_entry) in grouped: 70 | leaked = end_entry.consumed_ram - start_entry.consumed_ram 71 | if leaked > LEAK_LIMIT: 72 | leaks.append((leaked // 1024 // 1024, nodeid, 73 | end_entry.consumed_ram // 1024 // 1024)) 74 | if SORT_LEAKS: 75 | leaks.sort() 76 | for t in leaks: 77 | terminalreporter.write( 78 | 'LEAKED %s MB in %s. Total: %s MB\n' % t) 79 | -------------------------------------------------------------------------------- /conda-recipe/meta.yaml: -------------------------------------------------------------------------------- 1 | {% set data = load_setup_py_data() %} 2 | 3 | package: 4 | name: straditize 5 | version: {{ data.get('version') }} 6 | 7 | source: 8 | git_url: ../ 9 | 10 | build: 11 | number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }} 12 | string: py{{ CONDA_PY }}_{{ environ.get('GIT_BUILD_STR', '') }}{% if environ.get('GIT_BRANCH') %}_{{ environ.get('GIT_BRANCH').replace('-', '') }}{% endif %} 13 | script: python -m pip install . --no-deps --ignore-installed -vvv 14 | skip: true # [py == 27] 15 | entry_points: 16 | - straditize = straditize.__main__:main 17 | 18 | requirements: 19 | host: 20 | - python 21 | - pip 22 | run: 23 | - python 24 | - psyplot-gui >=1.2.3 25 | - psyplot >=1.2.0 26 | - netcdf4 27 | - pyqt >=5 28 | - scipy 29 | - numpy >=1.12 # [win] 30 | - scikit-image 31 | - openpyxl 32 | - sphinx !=1.7.5 33 | - psy-strat 34 | 35 | test: 36 | requires: 37 | - pytest 38 | - codecov 39 | - pytest-cov >=2.6.1 40 | - tesserocr # [not win] 41 | - psutil 42 | source_files: 43 | - tests 44 | imports: 45 | - straditize 46 | - straditize.widgets 47 | commands: 48 | - straditize --help 49 | - pytest -v --cov=straditize 50 | --ignore=tests/widgets/test_selection_toolbar.py 51 | --ignore=tests/widgets/test_samples_table.py 52 | --ignore=tests/widgets/test_beginner.py 53 | --ignore=tests/widgets/test_hoya_del_castillo.py 54 | - pytest -v --cov=straditize --cov-append tests/widgets/test_selection_toolbar.py::StraditizerSelectionToolsTest 55 | - pytest -v --cov=straditize --cov-append tests/widgets/test_selection_toolbar.py::ReaderSelectionToolsTest 56 | - pytest -v --cov=straditize --cov-append tests/widgets/test_selection_toolbar.py::ReaderGreyScaleToolsTest 57 | - pytest -v --cov=straditize --cov-append tests/widgets/test_samples_table.py 58 | - pytest -v --cov=straditize --cov-append tests/widgets/test_beginner.py 59 | - pytest -v --cov=straditize --cov-append tests/widgets/test_hoya_del_castillo.py 60 | - codecov 61 | 62 | app: 63 | entry: straditize 64 | icon: logo.png 65 | summary: Stratigraphic Diagram Digitization software 66 | type: desk 67 | 68 | about: 69 | home: https://github.com/Chilipp/straditize 70 | license: GPLv3 71 | license_family: GPL3 72 | license_file: LICENSE 73 | summary: 'Python package for digitizing pollen diagrams' 74 | 75 | description: | 76 | A software for a semi-automatic digitization of pollen diagrams or 77 | other types of stratigraphic diagrams using the command line or a 78 | graphical user interface. 79 | doc_url: http://straditize.readthedocs.io/ 80 | dev_url: https://github.com/Chilipp/straditize 81 | 82 | extra: 83 | recipe-maintainers: 84 | - Chilipp 85 | -------------------------------------------------------------------------------- /straditize/widgets/docs/marker_control.rst: -------------------------------------------------------------------------------- 1 | .. _marker-control: 2 | 3 | Configuring the appearance of markers 4 | ===================================== 5 | In the digitization, you will work with markers to select parts of your image. 6 | These can be the marks to :ref:`select the diagram part `, to 7 | :ref:`separate the columns ` or to 8 | :ref:`edit your samples `. 9 | 10 | You can modify the appearance of the marks using the :guilabel:`Marker control` 11 | section in the straditization control. This helps you to better visualize and 12 | select different parts in the diagram. 13 | 14 | .. image:: marker-control.png 15 | 16 | The functionalities are 17 | 18 | :guilabel:`Auto-hide` 19 | Hide the lines of the marks, when they are not selected 20 | :guilabel:`Show additionals` 21 | When :ref:`editing the samples `, for example, you will also 22 | see the rough locations of the samples for each column (little grey 23 | crosses). With the `Show additionals` setting, you can hide or show them 24 | :guilabel:`Show vertical lines` and :guilabel:`Show horizontal lines` 25 | If your marks are crosses, e.g. when you are 26 | :ref:`selecting the diagram part `, you can hide and show 27 | the vertical or horizontal lines with these settings 28 | :guilabel:`Drag in y-direction` and :guilabel:`Drag in x-direction` 29 | If unchecked, a mark cannot be moved along the corresponding axes. You can 30 | use this option, if you want to change the y-value of a mark without 31 | changing the x-value (or the other way around) 32 | :guilabel:`Horizontal lines selectable` and :guilabel:`Vertical lines selectable` 33 | If you uncheck one of these, you can prevent selecting a mark from the 34 | horizontal or vertical position. By default, you can select and move/drag 35 | a mark, by clicking on either of the lines (horizontal or vertical). But, 36 | for example, when editing the samples, many marks may lie on the same 37 | vertical position. Therefore it can be hard to move the mark of interest 38 | if you're selecting the vertical line of the mark. 39 | :guilabel:`Line color` 40 | This changes the color of all marks. 41 | :guilabel:`Line width` 42 | This changes the line width of the marks. Sometimes it is better, if the 43 | linewidth increases when you are selecting a line 44 | :guilabel:`Line style` 45 | You can change the style of the lines, to a dotted line, dashed line, etc. 46 | :guilabel:`Marker size` and :guilabel:`Marker style` 47 | The location of the marks, i.e. where vertical and horizontal lines 48 | intersect, e.g. on corner of the diagram when 49 | :ref:`selecting the diagram part `, has a marker associated 50 | with it. It shows you, where the corner of your diagram is, where the 51 | sample value is, etc.. To make this more visible, you can change the size 52 | and the appearance of the mark. 53 | -------------------------------------------------------------------------------- /straditize/widgets/docs/edit_samples.rst: -------------------------------------------------------------------------------- 1 | .. include:: 2 | 3 | .. _edit-samples: 4 | 5 | Editing samples 6 | =============== 7 | To edit samples, click the :guilabel:`Edit samples` button and a new 8 | figure will be created with one mark for each sample and a table is shown 9 | to you with the samples data. To edit the samples, you can edit the 10 | table or the marks in the plots 11 | 12 | The sample table 13 | --------------------- 14 | .. image:: samples-editor.png 15 | 16 | The sample table shows you the vertical coordinates of the 17 | samples and the values for each column obtained through the digitization. 18 | 19 | Each row in this table represents one sample in the diagram. 20 | 21 | The first column is the vertical location (y-axis) of the sample, the 22 | remaining columns are the x-values of the samples. The numbers shown in 23 | the table are in pixel coordinates of the diagram part. To interact with the 24 | samples, you can 25 | 26 | 1. Right click the table to add new or delete old samples/rows below or 27 | above the selected row 28 | 2. Edit the numbers in the cells to change the values for the samples. 29 | 3. Fit the x-values of the samples to the data. 30 | 31 | i. Either by right-click and `Fit selected cells to the data`, which will 32 | adjust the column values of the mark such, that it fits with the 33 | digitized value 34 | 35 | .. table:: 36 | :widths: auto 37 | 38 | +--------------+--------+----------------+ 39 | | original | | fitted to data | 40 | +--------------+--------+----------------+ 41 | | |displaced| | |rarr| | |corrected| | 42 | +--------------+--------+----------------+ 43 | ii. Or by using the `Fit selected cells to selected data` checkbox. If this 44 | is checked: 45 | 46 | 1. select cells in the table 47 | 2. click on the plot 48 | 3. the cells will be updated with the x-values from the digitization at 49 | the click-position 50 | 51 | .. |displaced| image:: displaced-mark.png 52 | 53 | .. |corrected| image:: corrected-mark.png 54 | 55 | You can also zoom the selection or hide everything else but the selection. 56 | 57 | Editing the marks 58 | ----------------- 59 | .. image:: edit-samples-marks.png 60 | 61 | Additional to the table, you have a visual representation of the samples 62 | in the figure. Here, you have one plot per column each mark represents the 63 | vertical location of a sample. The marker ``x`` in the line shows you the 64 | value of the sample (i.e. the location on the x-axes). 65 | 66 | 1. move a sample by 67 | 68 | i. left-click a mark and hold the mouse button (the mark will change it's 69 | color) 70 | ii. while still holing the mouse button, drag the mark to a different 71 | location 72 | 2. delete a sample by right-clicking the mark 73 | 3. add a new sample by holding down the :kbd:`Shift` button and left-click 74 | on one of the plots. 75 | -------------------------------------------------------------------------------- /straditize/widgets/docs/terminology.rst: -------------------------------------------------------------------------------- 1 | .. include:: 2 | 3 | .. _terminology: 4 | 5 | Basics and Terminology 6 | ====================== 7 | 8 | .. image:: sample_diagram.png 9 | :width: 100% 10 | 11 | A stratigraphic diagram consists of multiple diagrams that are vertically 12 | or horizontally aligned, i.e. that have either the same x- or y-axis. 13 | 14 | This software assumes, that all the subdiagrams share the y-axis, i.e. the 15 | vertical axis. If this is not the case for your specific diagram, just rotate 16 | your image by 90\ |deg|\ . 17 | 18 | column 19 | One column in the diagram means one of the subdiagrams (e.g. *Betula* in 20 | the example diagram above). The total number of columns is the number 21 | of subdiagrams in your plot. 22 | pixel column 23 | One pixel column is the horizontal pixel index (x-axis), ranging from 0 to 24 | the width of your image. Pixel column 0 represents all pixels on the very 25 | left side. 26 | row or pixel row 27 | One pixel row (or sometimes only *row*) is the vertical pixel index 28 | (y-axis), ranging from 0 to the height of your image. Row 0 represents all 29 | pixels at the top. 30 | diagram part 31 | This is the part where the data is shown (red rectangle in the figure 32 | above). 33 | binary image 34 | The binary image is the diagram part converted to black (1) and white (0). 35 | Every black pixel in this binary image represents data that should be 36 | digitized. 37 | digitize 38 | Digitization means transforming each pixel into a value (see the blue line 39 | in the image above). Therefore, in contrast to the samples, you get 40 | one data value for each pixel row in the binary image. We also refer to this 41 | as the `full data`. 42 | 43 | .. image:: digitize-vs-sample.png 44 | :width: 50% 45 | :align: center 46 | sample 47 | The samples (red lines in the image above) are a subset of the 48 | digitization result. In a very basic sense, the samples represent the 49 | original data that was used to create the diagram. In a sediment core for a 50 | pollen diagram, it would be one slice of the core that was analyzed under 51 | the microscope. 52 | straditizer 53 | Everything that refers to the straditizer refers to the full image of your 54 | stratigraphic diagram. Speaking in a programmatically sense, it is the 55 | top-level interface to digitize the diagram, an instance of the 56 | :class:`straditize.straditizer.Straditizer` class. You can always access 57 | the current straditizer through the ``stradi`` variable in the ipython 58 | console of the GUI 59 | reader or data reader 60 | This is the object that digitizes the diagram part (red area above). For 61 | different diagram types (area plot, bar plot, etc.) you have different 62 | readers with different functionalities. 63 | 64 | The reader of your diagram can be accessed via typing 65 | ``stradi.data_reader`` in the ipython console of the GUI. 66 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/beginner/beginner-tutorial-plot-navigation.rst: -------------------------------------------------------------------------------- 1 | Navigation inside the plot 2 | ========================== 3 | 4 | Now you see the stratigraphic diagram (by default) centered at the top of the 5 | graphical user interface. Additionally you find a separate window to it's 6 | right with a magnified version of the diagram. It follows your mouse movements 7 | inside the diagram and shows you a magnified version of it. 8 | 9 | To navigate inside the plot, you can use the default navigation toolbar that 10 | is provided by matplotlib 11 | 12 | .. image:: matplotlib-navigation-toolbar.png 13 | 14 | Especially the Pan/Zoom button |pan| and the zoom-to-rectangle button |zoom| 15 | are of interest for you. You can enable and disable them by clicking on the 16 | corresponding button in the toolbar. 17 | 18 | The `matplotlib docs`_ provide further guidance: 19 | 20 | .. image:: move_large.png 21 | 22 | The ``Pan/Zoom`` button 23 | This button has two modes: pan and zoom. Click the toolbar button 24 | to activate panning and zooming, then put your mouse somewhere 25 | over an axes. Press the left mouse button and hold it to pan the 26 | figure, dragging it to a new position. When you release it, the 27 | data under the point where you pressed will be moved to the point 28 | where you released. If you press 'x' or 'y' while panning the 29 | motion will be constrained to the x or y axis, respectively. Press 30 | the right mouse button to zoom, dragging it to a new position. 31 | The x axis will be zoomed in proportionately to the rightward 32 | movement and zoomed out proportionately to the leftward movement. 33 | The same is true for the y axis and up/down motions. The point under your 34 | mouse when you begin the zoom remains stationary, allowing you to 35 | zoom in or out around that point as much as you wish. You can use the 36 | modifier keys 'x', 'y' or 'CONTROL' to constrain the zoom to the x 37 | axis, the y axis, or aspect ratio preserve, respectively. 38 | 39 | With polar plots, the pan and zoom functionality behaves 40 | differently. The radius axis labels can be dragged using the left 41 | mouse button. The radius scale can be zoomed in and out using the 42 | right mouse button. 43 | 44 | .. image:: zoom_to_rect_large.png 45 | 46 | The ``Zoom-to-rectangle`` button 47 | Click this toolbar button to activate this mode. Put your mouse somewhere 48 | over an axes and press a mouse button. Define a rectangular region by 49 | dragging the mouse while holding the button to a new location. When using 50 | the left mouse button, the axes view limits will be zoomed to the defined 51 | region. When using the right mouse button, the axes view limits will be 52 | zoomed out, placing the original axes in the defined region. 53 | 54 | More information can be found in the matplotlib documentation: 55 | https://matplotlib.org/users/navigation_toolbar.html 56 | 57 | .. |pan| image:: move_large.png 58 | :width: 1.3em 59 | 60 | .. |zoom| image:: zoom_to_rect_large.png 61 | :width: 1.3em 62 | 63 | .. _matplotlib docs: https://matplotlib.org/users/navigation_toolbar.html 64 | -------------------------------------------------------------------------------- /paper/paper.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: 'straditize: Digitizing stratigraphic diagrams' 3 | tags: 4 | - digitization 5 | - pollen diagram 6 | - palynology 7 | - stratigraphy 8 | - stratigraphic diagram 9 | - earth science 10 | - climate 11 | - matplotlib 12 | - python 13 | authors: 14 | - name: Philipp S. Sommer 15 | orcid: 0000-0001-6171-7716 16 | affiliation: 1 17 | - name: Dilan Rech 18 | orcid: 0000-0002-2961-4271 19 | affiliation: 1 20 | - name: Manuel Chevalier 21 | orcid: 0000-0002-8183-9881 22 | affiliation: 1 23 | - name: Basil A. S. Davis 24 | orcid: 0000-0002-7148-1863 25 | affiliation: 1 26 | affiliations: 27 | - name: Institute of Earth Surface Dynamics, University of Lausanne, Géopolis, 1015 Lausanne, Switzerland 28 | index: 1 29 | date: 14 January 2019 30 | bibliography: paper.bib 31 | --- 32 | 33 | # Summary 34 | 35 | In an age of digital data analysis, gaining access to data from the pre-digital 36 | era – or any data that is only available as a figure on a page – remains a 37 | problem and an under-utilized scientific resource. Whilst there are numerous 38 | programs available that allow the digitization of scientific data in a simple 39 | x-y graph format, we know of no semi-automated program that can deal with data 40 | plotted with multiple horizontal axes that share the same vertical axis, such 41 | as pollen diagrams (see image below) and other stratigraphic figures that are 42 | common in the Earth sciences. `Straditize` (Stratigraphic Diagram Digitizer) 43 | [@Sommer2019] fills this gap. It is an open-source program that allows 44 | stratigraphic figures to be digitized in a single semi-automated operation. It 45 | is designed to detect multiple plots of variables analyzed along the same 46 | vertical axis, whether this is a sediment core or any similar depth/time 47 | series. 48 | 49 | ![A standard pollen diagram from Hoya del Castillo with data from @Davis2007](hoya-del-castillo.png){ width=80% } 50 | 51 | The program supports mixtures of many different 52 | diagram types, such as bar plots, line plots, as well as shaded, stacked, and 53 | filled area plots. Other features of `straditize` include text recognition to 54 | interpret the names of the different plotted variables, the automatic and 55 | semi-automatic recognition of picture artifacts, as well an automatic 56 | measurement finder to exactly reproduce the data that has been used to create 57 | the diagram. 58 | 59 | `Straditize` is written in the programming language Python and is available for 60 | Windows, Linux and MacOS. Being implemented in the visualization framework 61 | psyplot [@Sommer2017] it provides an extensively documented graphical 62 | user interface for a point-and-click handling of the semi-automatic process, 63 | but can also be scripted or used from the command line. The visualization is 64 | based on matplotlib [@Hunter2007] and most of the detection algorithms 65 | use image recognition functions from the scikit-image package [@Walt2014] and 66 | numeric routines from scipy [@Jones2001] and numpy [@Oliphant2006]. 67 | 68 | # Acknowledgements 69 | 70 | We gratefully acknowledge funding by the Swiss National Science Foundation 71 | (SNF) through the HORNET project (200021_169598). 72 | 73 | # References 74 | -------------------------------------------------------------------------------- /paper/paper.bib: -------------------------------------------------------------------------------- 1 | @article{Hunter2007, 2 | author={J. D. Hunter}, 3 | journal={Computing in Science Engineering}, 4 | title={Matplotlib: A 2D Graphics Environment}, 5 | year={2007}, 6 | volume={9}, 7 | number={3}, 8 | pages={90--95}, 9 | keywords={computer graphics;mathematics computing;object-oriented programming;software packages;2D graphics package;Matplotlib;Python;application development;interactive scripting;operating system;publication-quality image generation;user interface;Computer languages;Equations;Graphical user interfaces;Graphics;Image generation;Interpolation;Operating systems;Packaging;Programming profession;User interfaces;Python;application development;scientific programming;scripting languages}, 10 | doi={10.1109/MCSE.2007.55}, 11 | ISSN={1521-9615}, 12 | month={May} 13 | } 14 | 15 | @Article{Sommer2017, 16 | author = {Sommer, Philipp S.}, 17 | title = {The psyplot interactive visualization framework}, 18 | journal = {The Journal of Open Source Software}, 19 | year = {2017}, 20 | volume = {2}, 21 | number = {16}, 22 | month = {aug}, 23 | doi = {10.21105/joss.00363}, 24 | publisher = {The Open Journal}, 25 | url = {https://doi.org/10.21105/joss.00363}, 26 | } 27 | 28 | @Article{Walt2014, 29 | author = {van der Walt, {S}t\'efan and {S}ch\"onberger, {J}ohannes {L}. and {Nunez-Iglesias}, {J}uan and {B}oulogne, {F}ran\c{c}ois and {W}arner, {J}oshua {D}. and {Y}ager, {N}eil and {G}ouillart, {E}mmanuelle and {Y}u, {T}ony and the scikit-image contributors}, 30 | title = {scikit-image: image processing in {P}ython}, 31 | journal = {PeerJ}, 32 | year = {2014}, 33 | volume = {2}, 34 | pages = {e453}, 35 | month = {6}, 36 | issn = {2167-8359}, 37 | doi = {10.7717/peerj.453}, 38 | keywords = {Image processing, Reproducible research, Education, Visualization, Open source, Python, Scientific programming}, 39 | url = {http://dx.doi.org/10.7717/peerj.453}, 40 | } 41 | 42 | @Article{Davis2007, 43 | author = {Davis, Basil A. S. and Stevenson, A. C.}, 44 | title = {The 8.2ka event and Early–Mid Holocene forests, fires and flooding in the Central Ebro Desert, NE Spain}, 45 | journal = {Quat. Sci. Rev.}, 46 | year = {2007}, 47 | volume = {26}, 48 | number = {13-14}, 49 | pages = {1695-1712}, 50 | issn = {02773791}, 51 | doi = {10.1016/j.quascirev.2007.04.007}, 52 | type = {Journal Article}, 53 | url = {https://dx.doi.org/10.1016/j.quascirev.2007.04.007}, 54 | } 55 | 56 | @Misc{Jones2001, 57 | author = {Eric Jones and Travis Oliphant and Pearu Peterson and others}, 58 | title = {{SciPy}: Open source scientific tools for {Python}}, 59 | year = {2001}, 60 | note = {[Online; accessed 2017-02-18]}, 61 | url = {http://www.scipy.org/} 62 | } 63 | 64 | @Book{Oliphant2006, 65 | title = {A guide to NumPy}, 66 | publisher = {Trelgol Publishing USA}, 67 | year = {2006}, 68 | author = {Oliphant, Travis E}, 69 | volume = {1}, 70 | url = {http://www.numpy.org/}, 71 | } 72 | 73 | @online{Sommer2019, 74 | author = {Sommer, Philipp S.}, 75 | title = {straditize: Python package for digitizing pollen diagrams}, 76 | year = 2019, 77 | url = {https://github.com/Chilipp/straditize}, 78 | urldate = {2019-01-15}, 79 | } 80 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | import os.path as osp 3 | from setuptools import setup, find_packages 4 | from setuptools.command.test import test as TestCommand 5 | import sys 6 | 7 | 8 | class PyTest(TestCommand): 9 | user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")] 10 | 11 | def initialize_options(self): 12 | TestCommand.initialize_options(self) 13 | self.pytest_args = '' 14 | 15 | def run_tests(self): 16 | import shlex 17 | # import here, cause outside the eggs aren't loaded 18 | import pytest 19 | errno = pytest.main(shlex.split(self.pytest_args)) 20 | sys.exit(errno) 21 | 22 | 23 | def readme(): 24 | with open('README.rst') as f: 25 | return f.read() 26 | 27 | 28 | # read the version from version.py 29 | with open(osp.join('straditize', 'version.py')) as f: 30 | exec(f.read()) 31 | 32 | 33 | dependencies = [ 34 | 'psyplot-gui>=1.2.3', 35 | 'psyplot>=1.2.0', 36 | 'psy-strat', 37 | 'scipy', 38 | 'scikit-image', 39 | 'openpyxl', 40 | 'netCDF4', 41 | ] 42 | 43 | # Test for PyQt5 dependency. During a conda build, this is handled by the 44 | # meta.yaml so we can skip this dependency 45 | if not os.getenv('CONDA_BUILD'): 46 | # The package might nevertheless be installed, just registered with a 47 | # different name 48 | try: 49 | import PyQt5 50 | except ImportError: 51 | dependencies.append('pyqt5!=5.12') 52 | dependencies.append('PyQtWebEngine') 53 | dependencies.append('pyqt5-sip') 54 | 55 | 56 | setup(name='straditize', 57 | version=__version__, 58 | description='Python package for digitizing pollen diagrams', 59 | long_description=readme(), 60 | classifiers=[ 61 | 'Development Status :: 7 - Inactive', 62 | 'Intended Audience :: Science/Research', 63 | 'Topic :: Scientific/Engineering :: Visualization', 64 | 'Topic :: Scientific/Engineering :: GIS', 65 | 'Topic :: Scientific/Engineering', 66 | 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', 67 | 'Programming Language :: Python :: 3', 68 | 'Programming Language :: Python :: 3.6', 69 | 'Programming Language :: Python :: 3.7', 70 | 'Operating System :: OS Independent', 71 | ], 72 | keywords=('visualization earth-sciences paleo climate paleoclimate ' 73 | 'pollen diagram digitization database'), 74 | url='https://github.com/Chilipp/straditize', 75 | author='Philipp Sommer', 76 | author_email='philipp.sommer@unil.ch', 77 | license="GPLv3", 78 | packages=find_packages(exclude=['docs', 'tests*', 'examples']), 79 | install_requires=dependencies, 80 | package_data={'straditize': [ 81 | osp.join('straditize', 'widgets', 'icons', '*.png'), 82 | osp.join('straditize', 'widgets', 'docs', '*.rst'), 83 | osp.join('straditize', 'widgets', 'docs', '*.png'), 84 | osp.join('straditize', 'widgets', 'tutorial', '*', '*.rst'), 85 | osp.join('straditize', 'widgets', 'tutorial', '*', '*.png'), 86 | ]}, 87 | include_package_data=True, 88 | tests_require=['pytest', 'psutil'], 89 | cmdclass={'test': PyTest}, 90 | entry_points={ 91 | 'console_scripts': ['straditize=straditize.__main__:main'], 92 | 'psyplot_gui': ['straditizer=straditize.widgets:StraditizerWidgets'], 93 | }, 94 | zip_safe=False) 95 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at philipp.sommer@unil.ch. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /straditize/widgets/docs/removing_features.rst: -------------------------------------------------------------------------------- 1 | .. _remove-features: 2 | 3 | Removing features 4 | ================= 5 | The diagram part is converted to a binary image where everything black 6 | (i.e. 1) represents data (see :ref:`select-reader`). So before the data is 7 | digitized, features that do not represent data have to be removed. 8 | 9 | Here, you can either use the 10 | :ref:`features of the selection toolbar `, 11 | or you use one of the automatic removal tools we provide here. Note that you 12 | can edit every selection using the 13 | :ref:`mouse selection tools ` or the 14 | :ref:`automatic tools ` from the selection toolbar. 15 | 16 | After you selected the features to remove, click the :guilabel:`Remove` button 17 | at the bottom of the straditizer control panel. 18 | 19 | 20 | +------------------------------------------------------------+-----------------------------------------------------+ 21 | | :ref:`x-axes ` | :ref:`y-axes ` | 22 | +------------------------------------------------------------+-----------------------------------------------------+ 23 | | |xaxes| | |yaxes| | 24 | +------------------------------------------------------------+-----------------------------------------------------+ 25 | | :ref:`horizontal lines ` | :ref:`vertical lines ` | 26 | +------------------------------------------------------------+-----------------------------------------------------+ 27 | | |hlines| | |vlines| | 28 | +------------------------------------------------------------+-----------------------------------------------------+ 29 | | :ref:`features at column ends ` | :ref:`disconnected features ` | 30 | +------------------------------------------------------------+-----------------------------------------------------+ 31 | | |col-ends| | |disco| | 32 | +------------------------------------------------------------+-----------------------------------------------------+ 33 | | :ref:`cross column features ` | :ref:`small artifacts ` | 34 | +------------------------------------------------------------+-----------------------------------------------------+ 35 | | |cross-col| | |small| | 36 | +------------------------------------------------------------+-----------------------------------------------------+ 37 | 38 | 39 | .. |xaxes| image:: basic_diagram_xaxes.png 40 | :target: remove_lines.html 41 | 42 | .. |yaxes| image:: basic_diagram_yaxes.png 43 | :target: remove_lines.html 44 | 45 | .. |hlines| image:: basic_diagram_hlines.png 46 | :target: remove_lines.html 47 | 48 | .. |vlines| image:: basic_diagram_vlines.png 49 | :target: remove_lines.html 50 | 51 | .. |col-ends| image:: basic_diagram_features_at_col_ends.png 52 | :target: remove_col_ends.html 53 | 54 | .. |disco| image:: basic_diagram_disconnected.png 55 | :target: remove_disconnected_parts.html 56 | 57 | .. |cross-col| image:: basic_diagram_cross_col.png 58 | :target: remove_cross_column.html 59 | 60 | .. |small| image:: basic_diagram_small_features.png 61 | :target: remove_small_parts.html 62 | 63 | 64 | .. toctree:: 65 | :hidden: 66 | 67 | remove_col_ends 68 | remove_cross_column 69 | remove_disconnected_parts 70 | remove_lines 71 | remove_small_parts 72 | -------------------------------------------------------------------------------- /tests/widgets/test_plots.py: -------------------------------------------------------------------------------- 1 | """Test the straditize.widgets.plots module""" 2 | import numpy as np 3 | import pandas as pd 4 | import os.path as osp 5 | import _base_testing as bt 6 | import unittest 7 | from psyplot_gui.compat.qtcompat import QTest, Qt 8 | 9 | 10 | class PlotControlTableTest(bt.StraditizeWidgetsTestCase): 11 | """A test case for testing the plotting functions""" 12 | 13 | @property 14 | def table(self): 15 | return self.straditizer_widgets.plot_control.table 16 | 17 | def _test_plot(self, key): 18 | def test_plot(): 19 | QTest.mouseClick(btn, Qt.LeftButton) 20 | a = None 21 | for a in get_artists(): 22 | self.assertTrue(a.get_visible()) 23 | self.assertIsNotNone(a, msg='No artist plotted!') 24 | self._test_hiding(key) 25 | 26 | def test_remove(): 27 | QTest.mouseClick(btn, Qt.LeftButton) 28 | self.assertIsNone(next(iter(get_artists()), None)) 29 | 30 | get_artists = self.table.get_artists_funcs[key] 31 | is_plotted = next(iter(get_artists()), None) 32 | row = list(self.table.get_artists_funcs).index(key) 33 | btn = self.table.cellWidget(row, 1) 34 | if is_plotted: 35 | test_remove() 36 | test_plot() 37 | else: 38 | test_plot() 39 | test_remove() 40 | 41 | def _test_hiding(self, key): 42 | """Test a plotting function""" 43 | def test_if_visible(): 44 | cb.setChecked(True) 45 | for a in get_artists(): 46 | self.assertTrue(a.get_visible()) 47 | 48 | def test_if_hidden(): 49 | cb.setChecked(False) 50 | for a in get_artists(): 51 | self.assertFalse(a.get_visible()) 52 | 53 | get_artists = self.table.get_artists_funcs[key] 54 | row = list(self.table.get_artists_funcs).index(key) 55 | cb = self.table.cellWidget(row, 0) 56 | is_shown = cb.isChecked() 57 | if is_shown: 58 | test_if_hidden() 59 | test_if_visible() 60 | else: 61 | test_if_visible() 62 | test_if_hidden() 63 | 64 | def test_plot_full_image(self): 65 | """Test disabling and enabling the plot of the full image""" 66 | self._test_hiding('Full image') 67 | 68 | def test_plot_data_background(self): 69 | self.init_reader() 70 | self._test_hiding('Data background') 71 | 72 | def test_plot_binary_image(self): 73 | self.init_reader() 74 | self._test_hiding('Binary image') 75 | 76 | def test_plot_diagram_part(self): 77 | self.open_img() 78 | self.set_data_lims() 79 | self._test_plot('Diagram part') 80 | 81 | def test_plot_column_starts(self): 82 | self.init_reader() 83 | self.reader.column_starts = self.column_starts 84 | self.straditizer_widgets.refresh() 85 | self._test_plot('Column starts') 86 | 87 | def test_plot_full_df(self): 88 | self.init_reader() 89 | self.reader.column_starts = self.column_starts 90 | self.reader.digitize() 91 | self.straditizer_widgets.refresh() 92 | self._test_plot('Full digitized data') 93 | 94 | def test_plot_potential_samples(self): 95 | self.init_reader() 96 | self.reader.column_starts = self.column_starts 97 | self.reader.digitize() 98 | self.straditizer_widgets.refresh() 99 | self._test_plot('Potential samples') 100 | 101 | def test_plot_samples(self): 102 | self.init_reader() 103 | self.reader.column_starts = self.column_starts 104 | self.reader.digitize() 105 | self.reader._get_sample_locs() 106 | self.straditizer_widgets.refresh() 107 | self._test_plot('Samples') 108 | 109 | def test_plot_reconstruction(self): 110 | self.init_reader() 111 | self.reader.column_starts = self.column_starts 112 | self.reader.digitize() 113 | self.reader._get_sample_locs() 114 | self.straditizer_widgets.refresh() 115 | self._test_plot('Reconstruction') 116 | 117 | 118 | if __name__ == '__main__': 119 | unittest.main() 120 | -------------------------------------------------------------------------------- /straditize/widgets/axes_translations.py: -------------------------------------------------------------------------------- 1 | """Module for translating the x- and y-axes from pixel into data coordinates 2 | 3 | **Disclaimer** 4 | 5 | Copyright (C) 2018-2019 Philipp S. Sommer 6 | 7 | This program is free software: you can redistribute it and/or modify 8 | it under the terms of the GNU General Public License as published by 9 | the Free Software Foundation, either version 3 of the License, or 10 | (at your option) any later version. 11 | 12 | This program is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | GNU General Public License for more details. 16 | 17 | You should have received a copy of the GNU General Public License 18 | along with this program. If not, see . 19 | """ 20 | from straditize.widgets import StraditizerControlBase 21 | from psyplot_gui.compat.qtcompat import QPushButton, QTreeWidgetItem 22 | from straditize.common import docstrings 23 | from functools import partial 24 | 25 | 26 | class AxesTranslations(StraditizerControlBase): 27 | """The control for translating x- and y-axes 28 | 29 | This object creates two buttons for translating x- and y-axes from pixel 30 | to data coordinates""" 31 | 32 | @property 33 | def tree(self): 34 | return self.straditizer_widgets.tree 35 | 36 | @docstrings.dedent 37 | def __init__(self, straditizer_widgets, item): 38 | """ 39 | Parameters 40 | ---------- 41 | %(StraditizerControlBase.init_straditizercontrol.parameters)s 42 | """ 43 | self.btn_marks_for_y = QPushButton('Insert Y-axis values') 44 | self.btn_marks_for_x = QPushButton('Insert X-axis values') 45 | 46 | self.btn_marks_for_y.clicked.connect(self.marks_for_y) 47 | self.btn_marks_for_x.clicked.connect(partial(self.marks_for_x, True)) 48 | 49 | self.widgets2disable = [self.btn_marks_for_x, self.btn_marks_for_y] 50 | 51 | self.init_straditizercontrol(straditizer_widgets, item) 52 | 53 | def setup_children(self, item): 54 | self.add_info_button(item, 'axes_translations.rst') 55 | child = QTreeWidgetItem(0) 56 | item.addChild(child) 57 | self.tree.setItemWidget(child, 0, self.btn_marks_for_x) 58 | self.add_info_button(child, 'xaxis_translation.rst', 59 | connections=[self.btn_marks_for_x]) 60 | child = QTreeWidgetItem(0) 61 | item.addChild(child) 62 | self.tree.setItemWidget(child, 0, self.btn_marks_for_y) 63 | self.add_info_button(child, 'yaxis_translation.rst', 64 | connections=[self.btn_marks_for_y]) 65 | 66 | def marks_for_y(self): 67 | """Create (or enable) the marks for the y-axis translation 68 | 69 | See Also 70 | -------- 71 | straditize.straditizer.Straditizer.marks_for_y_values 72 | straditize.straditizer.Straditizer.update_yvalues""" 73 | self.straditizer.marks_for_y_values() 74 | self.straditizer.draw_figure() 75 | self.connect2apply(self.straditizer.update_yvalues, 76 | self.straditizer.draw_figure, 77 | self.straditizer_widgets.refresh) 78 | self.connect2cancel(self.straditizer.remove_marks, 79 | self.straditizer.draw_figure) 80 | 81 | def marks_for_x(self, at_col_start=True): 82 | """Create (or enable) the marks for the x-axis translation 83 | 84 | See Also 85 | -------- 86 | straditize.straditizer.Straditizer.marks_for_x_values 87 | straditize.straditizer.Straditizer.update_xvalues""" 88 | self.straditizer.marks_for_x_values(at_col_start) 89 | self.straditizer.draw_figure() 90 | self.connect2apply(self.straditizer.update_xvalues, 91 | self.straditizer.draw_figure, 92 | self.straditizer_widgets.refresh) 93 | self.connect2cancel(self.straditizer.remove_marks, 94 | self.straditizer.draw_figure) 95 | 96 | def should_be_enabled(self, w): 97 | if self.straditizer is None: 98 | return False 99 | elif (w is self.btn_marks_for_x and 100 | (self.straditizer.data_reader is None or 101 | self.straditizer.data_reader._column_starts is None)): 102 | return False 103 | return True 104 | -------------------------------------------------------------------------------- /straditize/widgets/docs/column_names.rst: -------------------------------------------------------------------------------- 1 | .. _colnames: 2 | 3 | Handling column names 4 | ===================== 5 | Within straditize, you can assign a name to each of the columns in your 6 | diagram, which will then turn up as the header in your final export. Usually 7 | these names are the titles of your columns, e.g. such as here 8 | 9 | .. image:: sample_diagram-header.png 10 | :width: 100% 11 | :alt: sample diagram header 12 | 13 | To enter the names of the columns, hit the :guilabel:`Edit column names` button 14 | in the *Column names* section of the straditizer control. This will open a 15 | dialog to handle the column names: 16 | 17 | .. image:: colnames-editor.png 18 | :alt: column names editor 19 | 20 | On the left side, you have a rotated version of the image that you can control 21 | with the options above it. To navigate in this window, place your 22 | mouse over it and then you can move (pan) the image with left-click. 23 | 24 | Zooming in and out is done via right-click. To zoom in, hold your right mouse button and move 25 | your cursor to the upper right corner of your diagram. To zoom out, move it to 26 | the lower left corner. 27 | 28 | On the right side you have a table with the column names. Initially, these are 29 | just increasing numbers starting from 0 for your first column. If you select 30 | one column, it will be highlighted in the left image: 31 | 32 | .. image:: colnames-editor-highlighted.png 33 | :alt: highlighted first column 34 | 35 | You can now enter the name of the column, in this case Artemisia 36 | 37 | .. image:: colnames-editor-col0.png 38 | :alt: highlighted first column 39 | 40 | .. _colnames-ocr: 41 | 42 | Automatic optical character recognition (OCR) 43 | --------------------------------------------- 44 | You don't have to type the column name, you can also use the builtin text 45 | recognition. For this, we rely on the tesseract_ software that can be 46 | installed (on linux and MacOS) via:: 47 | 48 | conda install -c conda-forge tesseract 49 | 50 | see the `tesseract feedstock`_ on conda-forge. If you want to automatically 51 | find the column names, you also need tesserocr_ to be installed which can be 52 | done via:: 53 | 54 | pip install tesserocr 55 | 56 | or:: 57 | 58 | conda install -c chilipp tesserocr # on linux/MacOS 59 | 60 | (see https://pypi.org/project/tesserocr/ for more installation options, in 61 | particular for Windows). 62 | 63 | 1. Use a high resolution version of the image 64 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 65 | To improve the result of the text recognition, we recommend to use a sufficient 66 | resolution of about 600 dpi. If the image that you are digitizing does not have 67 | this resolution, you can optionally load a higher resolution version of it 68 | using the :guilabel:`Load HR image` button at the upper left of the dialog. 69 | 70 | We also recommend to remove everything in this file but the column names to 71 | improve the text recognition. 72 | 73 | 2. Automatically find all column names 74 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 75 | Check the `all columns` checkbox and click the :guilabel:`Find column names` 76 | button. This then will look for column names in the image that is displayed 77 | on the left of the table and insert them into the table. 78 | 79 | 3. Separate treatment of column names 80 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 81 | Now, select the first column in the table, zoom in such that you can see 82 | the name of the first column and click the :guilabel:`Select column name` 83 | button. 84 | 85 | You won't be able to zoom or pan in your plot anymore, but you can now draw a 86 | rectangle in the plot around the name of the first column or use click the 87 | :guilabel:`Find column names` button (without having the `all columns` 88 | checkbox checked) and it will show up in the plot on the lower right of the 89 | diagram. 90 | 91 | .. image:: colnames-editor-colpic.png 92 | :alt: picture of the first column name 93 | 94 | Here you see the result of the low resolution. If we instead specify a higher 95 | resolution image (see above), this can look much better 96 | 97 | .. image:: colnames-editor-colpic-HR.png 98 | :alt: picture of the first column name in highres 99 | 100 | Now click the :guilabel:`Recognize` button at the bottom and it will use 101 | tesseract to read the text in the image and fill in the table 102 | 103 | .. image:: colnames-editor-colpic-recognized.png 104 | :alt: recognized first column 105 | 106 | You can now select the next column or click the :guilabel:`Apply` button on the 107 | lower left. The latter will reenable the navigation (pan and zoom) in the plot. 108 | 109 | .. _tesseract: https://github.com/tesseract-ocr/tesseract 110 | .. _tesseract feedstock: https://github.com/conda-forge/tesseract-feedstock 111 | .. _tesserocr: https://pypi.org/project/tesserocr/ 112 | -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | ================================= 2 | Digitizing stratigraphic diagrams 3 | ================================= 4 | 5 | .. image:: http://unmaintained.tech/badge.svg 6 | :target: http://unmaintained.tech/ 7 | :alt: No Maintenance Intended 8 | 9 | .. start-badges 10 | 11 | .. list-table:: 12 | :stub-columns: 1 13 | :widths: 10 90 14 | 15 | * - docs 16 | - |docs| 17 | * - tests 18 | - |travis| |appveyor| |codecov| 19 | * - package 20 | - |version| |conda| |joss| |github| 21 | * - implementations 22 | - |supported-versions| |supported-implementations| 23 | 24 | .. |docs| image:: http://readthedocs.org/projects/straditize/badge/?version=latest 25 | :alt: Documentation Status 26 | :target: http://straditize.readthedocs.io/en/latest/?badge=latest 27 | 28 | .. |travis| image:: https://travis-ci.org/Chilipp/straditize.svg?branch=master 29 | :alt: Travis 30 | :target: https://travis-ci.org/Chilipp/straditize 31 | 32 | .. |appveyor| image:: https://ci.appveyor.com/api/projects/status/c1c8pqvh8h8rolxw?svg=true 33 | :alt: AppVeyor 34 | :target: https://ci.appveyor.com/project/Chilipp/straditize/branch/master 35 | 36 | .. |codecov| image:: https://codecov.io/gh/Chilipp/straditize/branch/master/graph/badge.svg 37 | :alt: Coverage 38 | :target: https://codecov.io/gh/Chilipp/straditize 39 | 40 | .. |version| image:: https://img.shields.io/pypi/v/straditize.svg?style=flat 41 | :alt: PyPI Package latest release 42 | :target: https://pypi.python.org/pypi/straditize 43 | 44 | .. |conda| image:: https://anaconda.org/conda-forge/straditize/badges/version.svg 45 | :alt: conda 46 | :target: https://anaconda.org/conda-forge/straditize 47 | 48 | .. |supported-versions| image:: https://img.shields.io/pypi/pyversions/straditize.svg?style=flat 49 | :alt: Supported versions 50 | :target: https://pypi.python.org/pypi/straditize 51 | 52 | .. |supported-implementations| image:: https://img.shields.io/pypi/implementation/straditize.svg?style=flat 53 | :alt: Supported implementations 54 | :target: https://pypi.python.org/pypi/straditize 55 | 56 | .. |joss| image:: http://joss.theoj.org/papers/10.21105/joss.01216/status.svg 57 | :alt: Journal of Open Source Software 58 | :target: https://doi.org/10.21105/joss.01216 59 | 60 | .. |github| image:: https://img.shields.io/github/release/Chilipp/straditize.svg 61 | :target: https://github.com/Chilipp/straditize/releases/latest 62 | :alt: Latest github release 63 | 64 | .. end-badges 65 | 66 | **This module is not maintained!!!** 67 | 68 | STRADITIZE (Stratigraphic Diagram Digitizer) is an open-source program that 69 | allows stratigraphic figures to be digitized in a single semi-automated 70 | operation. It is designed to detect multiple plots of variables analyzed along 71 | the same vertical axis, whether this is a sediment core or any similar 72 | depth/time series. 73 | 74 | Usually, in an age of digital data analysis, gaining access to data from the 75 | pre-digital era – or any data that is only available as a figure on a page – 76 | remains a problem and an under-utilized scientific resource. 77 | 78 | This program tackles this problem by providing a python package to digitize 79 | especially pollen diagrams, but also any other type of stratigraphic diagram. 80 | 81 | Straditize is written in python and supports mixtures of many different diagram 82 | types, such as bar plots, line plots, as well as shaded, stacked, and filled 83 | area plots. The package provides an extensively documented graphical user 84 | interface for a point-and-click handling of the semi-automatic process, but can 85 | also be scripted or used from the command line. Other features of STRADITIZE 86 | include text recognition to interpret the names of the different plotted 87 | variables, the automatic and semi-automatic recognition of picture artifacts, 88 | as well an automatic measurement finder to exactly reproduce the data that has 89 | been used to create the diagram. 90 | 91 | Installation 92 | ------------ 93 | We highly recommend to use anaconda_ and install straditize into its own 94 | environment:: 95 | 96 | conda create -n straditize -c conda-forge straditize 97 | conda activate straditize 98 | 99 | or install it from the source files via:: 100 | 101 | git clone https://github.com/Chilipp/straditize.git 102 | cd straditize 103 | pip install . # or python setup.py install, but pip is recommended 104 | 105 | It can then be started from the command line via:: 106 | 107 | straditize 108 | 109 | A more detailed description is provided in the docs_. 110 | 111 | .. _anaconda: https://conda.io/en/latest/miniconda.html 112 | .. _docs: https://straditize.readthedocs.io/en/latest/installing.html 113 | 114 | License 115 | ------- 116 | straditize is published under the 117 | `GNU General Public License v3.0 `__ 118 | under the copyright of Philipp S. Sommer, 2018-2019 119 | -------------------------------------------------------------------------------- /straditize/widgets/tutorial/hoya-del-castillo/hoya-del-castillo-tutorial-xaxis-translation.rst: -------------------------------------------------------------------------------- 1 | Translating the x-axes 2 | ====================== 3 | Additionally to the vertical axis, we have to tell straditize how to interprete 4 | the x-axes of the stratigraphic diagram. 5 | 6 | Here we have to deal different units of the x-axes in the diagrams. The first 7 | (`Charcoal`) and last (`Pollen Concentration`) columns are counts, the pollen 8 | taxa in between are in percent. 9 | 10 | Therefore we will create column specific readers, one for the first and one 11 | for the last column. Then we will insert the x-axis data. 12 | 13 | The steps down below are repetitive, but we will describe them for each step 14 | in detail. 15 | 16 | The `Charcoal` column 17 | --------------------- 18 | 1. Expand the `Current reader` tab in the digitization control 19 | 2. Click the :guilabel:`+` button to start the selection for a new reader 20 | 3. Click in the plot on the first column. It will turn red 21 | 22 | .. image:: charcoal-column.png 23 | 24 | 4. Click the :guilabel:`Apply` button and select the `area` reader in the 25 | appearing dialog 26 | 5. In the dropdown menu in the `Current reader` tab, select the reader for 27 | *Column 0* to make it the current reader. 28 | 29 | Now, we select the values for interpreting the x-axis of this column. The 30 | procedure is more or less the same, as before with the y-axis: 31 | 32 | 1. Click the :guilabel:`Insert X-axis values` button in the `Axes translations` 33 | section of the straditizer control 34 | 2. A small dialog will appear where you should enter the x-value of the start 35 | of the column (here ``0``). 36 | 37 | .. note:: 38 | 39 | The dialog only appears, if the start of one of the selected columns is 40 | visible. If this is not the case, Shift-Leftclick on the plot to 41 | create a mark. 42 | 3. After hitting the :guilabel:`Ok` button, you will see a mark on the plot 43 | (blue line). You can select the mark via leftclick and drag it to a 44 | different location or you can delete it via rightclick. 45 | 4. now repeat steps 2-4 on a second point in the same column. Your diagram 46 | should now look something like this: 47 | 48 | .. image:: select-x0-col0.png 49 | 50 | 5. Click the :guilabel:`Apply` button at the bottom of the straditizer control 51 | and we can continue with the last column 52 | 53 | The `Pollen Concentration` column 54 | --------------------------------- 55 | 1. In the `Current reader` dropdown menu, select the reader for the columns 56 | 1-27 57 | 2. Click the :guilabel:`+` button to start the selection for a new reader 58 | 3. Click in the plot on the last column. It will turn red 59 | 60 | .. image:: pollen-concentration-column.png 61 | 62 | 4. Click the :guilabel:`Apply` button and select the `line` reader 63 | in the appearing dialog. 64 | 5. In the dropdown menu in the `Current reader` tab, select the reader for 65 | *Column 27* to make it the current reader. 66 | 67 | Now, we select the values for interpreting the x-axis of this column. The 68 | procedure is the same as above: 69 | 70 | 1. Click the :guilabel:`Insert X-axis values` button in the `Axes translations` 71 | section of the straditizer control 72 | 2. In the appearing dialog, enter the x-value of the column start (here again 73 | ``0``) or Shift-Leftclick on the plot and then enter it (see note above). 74 | 3. After hitting the :guilabel:`Ok` button, you will see a mark on the plot 75 | (blue line). Again, you can select the mark, drag it or delete it as before. 76 | 4. now repeat steps 2-4 on a second point in the same column. Your diagram 77 | should now look something like this: 78 | 79 | .. image:: select-x0-col27.png 80 | 81 | 5. Click the :guilabel:`Apply` button at the bottom of the straditizer control 82 | and we can continue with the pollen taxa. 83 | 84 | The pollen taxa columns 85 | ----------------------- 86 | Last but not least, we translate the x-axes informations for the pollen taxa. 87 | 88 | .. image:: pollen-taxa-columns.png 89 | 90 | Luckily, as it is common for pollen diagrams, they all have the same scaling. 91 | Therefore it is enough to perform the above steps just for one of the columns. 92 | 93 | 1. In the dropdown menu in the `Current reader` tab, select the reader for 94 | *Columns 1-26* to make it the current reader. 95 | 2. Click the :guilabel:`Insert X-axis values` button in the `Axes translations` 96 | section of the straditizer control 97 | 3. In the appearing dialog, enter the x-value of the column start (here again 98 | ``0``) or Shift-Leftclick on the plot and then enter it (see note above). 99 | 4. After hitting the :guilabel:`Ok` button, you will see a mark on the plot 100 | (blue line). Again, you can select the mark, drag it or delete it as before. 101 | 5. now repeat steps 2-4 on a second point in the same column. Your diagram 102 | should now look something like this: 103 | 104 | .. image:: select-x0-col1-26.png 105 | 106 | 6. Click the :guilabel:`Apply` button at the bottom of the straditizer control. 107 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: generic 2 | sudo: false # use container based build 3 | 4 | # set clone depth to false to make sure that conda build can write the 5 | # correct GIT_BUILD_STR 6 | git: 7 | depth: false 8 | 9 | env: 10 | matrix: 11 | - PYTHON_VERSION=3.7 USE_PIP=false DEPLOY_CONDA=true 12 | - PYTHON_VERSION=3.7 USE_PIP=true DEPLOY_CONDA=false 13 | - PYTHON_VERSION=3.6 USE_PIP=false DEPLOY_CONDA=true 14 | global: 15 | - secure: "YlB2al+7fppkHGVlEaRipwBoVodVzBR77KqBv3UrMmUQ8CRu6FwrMKX39EmbKq89K08q/wMfEtKfO15ICkffEVGlUKCE3VjFTf8tP55ccSgsIF9uXp21/iPJoPzVNhh4nvpp2tD5ObmCtBYVk1HV77ujah4WBTlAkaIIn6/vwvTh3eyFKqGqE4PLntTdQoBp68/5lVMDVCuAWzd1J8NUeWOlqZF4AVVNLGYgHDbeU3YZwpZ3ApRWUq8rjYWoYWO5630eXBcYaUJyhUxpXT1l5Am7j0WoaCAniKgqD8b74a8xY41A0lCDdIF1MtXNrNQ/UmsunP/uvDtVPjcRxiZA1WVhOFL+vpu+oju58IC8jTtfaKTkwUxwBGRn5E5EE5R08iltDOXxA1H+JYPzK6HKq3w2alwFA6/ctoWp5COxaPGL1L+vXsp+EqpcysN0wK94CJturiCYFCAbkN45jh4slywFfw8IzkqQq2yCN7cuPnURvk3MEH37Ss0NxD54hDUFHDOXNc7RY9KyE4vpufi0WPIlqFMxT4e5Zn0PkI1xChG5/XrLl6mCBytMhCXB+HcRMZq92AjO0vAeYRFCKgynMVgjIVCq1axEn/dolKvnjiv/riZzkJfdFggLUUy+VU4JS+kDAlTiZ0OEIfH6IgI5EHdFFRGgQ2MbJkX9wOxhVp4=" 16 | 17 | os: 18 | - linux 19 | - osx 20 | 21 | services: 22 | - xvfb 23 | 24 | matrix: 25 | allow_failures: 26 | - env: PYTHON_VERSION=3.7 USE_PIP=true DEPLOY_CONDA=false 27 | 28 | before_install: 29 | - if [[ "$TRAVIS_EVENT_TYPE" == "cron" ]]; then export DEPLOY_CONDA=false; fi 30 | # Remove homebrew. 31 | - | 32 | if [[ $TRAVIS_OS_NAME == "osx" ]]; then 33 | echo "" 34 | echo "Removing homebrew from Travis CI to avoid conflicts." 35 | curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall > ~/uninstall_homebrew 36 | chmod +x ~/uninstall_homebrew 37 | ~/uninstall_homebrew -fq 38 | rm ~/uninstall_homebrew 39 | fi 40 | # define functions to unset and reset encrypted variables 41 | - function unset_secure { 42 | CONDA_TOKEN_SAVE=$CONDA_REPO_TOKEN; 43 | unset CONDA_REPO_TOKEN; 44 | } 45 | - function reset_secure { 46 | export CONDA_REPO_TOKEN=$CONDA_TOKEN_SAVE; 47 | } 48 | - unset_secure 49 | # increase open files limit 50 | - ulimit -a 51 | - ulimit -Sn 10000 52 | - ulimit -a 53 | # select the os name for the conda installer 54 | - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then 55 | OS_NAME=MacOSX; 56 | else 57 | OS_NAME=Linux; 58 | fi 59 | # Install Miniconda. 60 | - | 61 | echo "" 62 | echo "Installing a fresh version of Miniconda." 63 | MINICONDA_URL="https://repo.continuum.io/miniconda" 64 | MINICONDA_FILE="Miniconda3-latest-${OS_NAME}-x86_64.sh" 65 | curl -L -O "${MINICONDA_URL}/${MINICONDA_FILE}" 66 | bash $MINICONDA_FILE -bp $HOME/miniconda3 67 | - source $HOME/miniconda3/bin/activate root 68 | - hash -r 69 | - reset_secure 70 | 71 | before_script: 72 | - if [[ $TRAVIS_OS_NAME == "linux" ]]; then 73 | export "DISPLAY=:99.0"; 74 | sh -e /etc/init.d/xvfb start; 75 | sleep 3; 76 | fi 77 | 78 | install: 79 | # unset the global CONDA_REPO_TOKEN variable because it is not needed 80 | # during the tests. This decreases the vulnerability 81 | - unset_secure 82 | - | 83 | echo "" 84 | echo "Configuring conda." 85 | conda config --set always_yes yes --set changeps1 no 86 | conda config --add channels conda-forge 87 | conda config --add channels chilipp 88 | conda config --add channels chilipp/label/master 89 | conda config --add channels chilipp/label/dev 90 | conda update -q conda 91 | conda install conda-build anaconda-client 92 | - 'echo "backend : module://psyplot_gui.backend" > matplotlibrc' 93 | - 'export MATPLOTLIBRC=`pwd`/matplotlibrc' 94 | - export PYTHONWARNINGS='ignore:mode:DeprecationWarning:docutils.io:245' 95 | - if [[ $TRAVIS_TAG == "" ]]; then export GIT_BRANCH=$TRAVIS_BRANCH; fi 96 | - if [[ $USE_PIP == true ]]; then pip install .; fi 97 | - conda info -a 98 | - conda list 99 | - reset_secure 100 | script: 101 | - unset_secure 102 | # install conda 103 | - if [[ $USE_PIP == true ]]; then 104 | python setup.py test -a ' 105 | --ignore=tests/widgets/test_selection_toolbar.py 106 | --ignore=tests/widgets/test_samples_table.py 107 | --ignore=tests/widgets/test_beginner.py 108 | --ignore=tests/widgets/test_hoya_del_castillo.py' && 109 | python setup.py test -a 'tests/widgets/test_selection_toolbar.py 110 | tests/widgets/test_samples_table.py' && 111 | python setup.py test -a 'tests/widgets/test_beginner.py' && 112 | python setup.py test -a 'tests/widgets/test_hoya_del_castillo.py'; 113 | else 114 | conda build conda-recipe --python $PYTHON_VERSION --clobber-file ci/recipe_clobber_${TRAVIS_OS_NAME}.yaml; 115 | fi 116 | # export the pw to make it available for the deploy 117 | - reset_secure 118 | # deploy here (don't use travis deploy because it requires homebrew) 119 | - if [[ $DEPLOY_CONDA == "true" && $USE_PIP == "false" && $TRAVIS_PULL_REQUEST == "false" && $TRAVIS_REPO_SLUG == "Chilipp/straditize" ]]; then 120 | ci/deploy_anaconda.py; 121 | fi 122 | --------------------------------------------------------------------------------