# CutView
CutView is a GUI for getting pixel data from images and data values from NetCDF files along a linear transects. This simplifies the analysis of satellite imagery or other images with linear features where the brightness of the pixel can be used to gauge some physical value. Examples include measuring sea ice floe concentration or characterizing ice sheet fractures. For NetCDF files, CutView serves as an easy way to view datasets quickly along any dimensions and extract data along transects. CutView is designed to make the measurement of linear features as automatic as possible through “marker” tools where linear features can be marked out and have transects automatically be made across. Multiple features can be marked at once on a file and saved all together as a “project” that can be reuploaded and continued or edited.
![](images/cutviewgraphic.png)
Users can display a plot of the data as well as package the data into a downloadable JSON file. When extracting values from the image/dataset, the program uses linear interpolation to interpolate between the values of the pixels to ensure the most accurate portrayal of the line drawn.
Please refer to the repo wiki for installation and usage instructions. This is an open source project. For contribution guidelines please refer to the contribution section of the [docs](https://cutview.readthedocs.io/en/latest/contribution.html).
# Installation Instructions
## Linux and Mac
1. It is recommended to first create a virtual environment (if your IDE does not do it for you) before installing packages on your system to prevent package compatibility issues. From the terminal at your desired directory use:
```
python3 -m venv venv
source venv/bin/activate
```
2. Then install CutView using PIP:
```
pip install cutview
```
3. To run the app execute the following Python code:
```
from cutview.cutview import CutView
CutView().run()
```
4. To exit virtual environment when finished:
```
deactivate
```
5. To open the same virtual environment again in the future simply execute:
```
source venv/bin/activate
```
## Windows
1. It is recommended to first create a virtual environment (if your IDE does not do it for you) before installing packages on your system to prevent package compatibility issues. From the terminal at your desired directory use:
```
python3 -m venv venv
venv\Scripts\activate
```
2. Then install CutView using PIP:
```
pip install cutview
```
3. To run the app execute the following Python code:
```
from cutview.cutview import CutView
CutView().run()
```
4. To exit virtual environment when finished:
```
deactivate
```
5. To open the same virtual environment again in the future simply execute:
```
venv\Scripts\activate
```
If you are having trouble installing CutView please refer to the Troubleshooting section of the [docs](https://cutview.readthedocs.io/en/latest/installation.html)
# Usage Instructions
* If you would like to try out the app there are example image and NetCDF files in the [support](https://github.com/rchartra/CutView/tree/master/support) folder of this repository
* Relative file paths:
`support/example.jpg`\
`support/test_img.png`\
`support/example_4v.nc `\
`support/example_3d.nc`\
* There is an example project file for upload as well:
`support/example_markers.json`
## Running app
1. To install the app, refer to installation instructions for your OS
2. Execute the following python code:
```
from cutview.cutview import CutView
CutView().run()
```
## Loading a file
1. To load image file or NetCDF file type the relative or absolute file path into file entry text path and select "Go"
* If you are loading a NetCDF file a popup window will appear with additional selections:
* Select which variable from your file you would like to see.
* Confirm or select which dimensions you would like to use as the X and Y axes for your variable.
* If your variable has data in a third dimension select the Z dimension and an initial Z value to display. You will be able to toggle between z values later.
* Select "Go" to load the selected data
2. You can scroll to zoom in and out of the image and can click and drag the image to move it around.
3. From the "View" menu in the settings bar you can rotate or flip the image as well as change graphic settings for the tools.
4. If you are loading a NetCDF file, from the "NetCDF" menu in the settings bar you can change which variable or z value you'd like to see as well as change the color map or contrast of the image.
## Tools
* To clear widgets from the viewer at any point click any of the tool buttons
### Transects
* This tool will make multiple transects between two points
1. Hit "Transect" to enter transect mode
2. Click two points you'd like to make a transect between
* Select "Drag Mode" from the actions sidebar to drag the image without selecting points, and select "Transect Mode" to go back.
* Select "Edit Mode" to delete either the last point clicked or the last transect drawn.
3. Repeat for as many transects as you'd like
4. When done select the "Plot" button and a popup will appear with a plot of all transects and downloading options.
* You can select which transects you'd like to plot
* If using a NetCDF file you can select multiple variables and Z values you'd like to see your selected transects plotted from.
* If using a NetCDF file with a Z dimension you can plot an image of a single transect taken over all Z values of your dataset. To use this option only one transect can be selected.
5. You can save the current plot to .PNG or .PDF formats. You can also save the **currently selected** data or the currently selected data over all Z variables to a JSON file (see "Data Output" section of the [docs](https://cutview.readthedocs.io/en/latest/data_output.html) for more on how data is formatted).
6. Click anywhere around the popup or the close button to dismiss plotting window.
### Marker
* This tool allows you to click along a feature and have transects automatically made perpendicular to the feature.
* You can mark out multiple features and save them all together as a single "project".
* You can upload previous projects to edit or continue them.
#### Working on a project
1. Hit the "Transect Marker" button to enter transect mode
2. Click points along the feature you'd like transects of. Dots will appear on either side of the line drawn indicating the start and end of the transects that will be made
* Select "Drag Mode" from the actions sidebar to drag the image without selecting points, and select "Transect Mode" to go back.
* Select "Edit Mode" to delete either the last point clicked or the last marker drawn.
* To change the width of the transects being made you may enter the number of pixels into the "Width" text box. Select "Go" to change the width for all future transects.
* This will not change the width of transects already drawn
* The default width is 40 pixels, you can enter any width within 0 and 400
* If you change the width of a marker any new markers will continue to use that same width unless you change it again.
3. Select "New Line" to begin a new marker and repeat for as many markers as you'd like
4. When done select the "Plot" button and a popup will appear with a plot of all transects from the first marker and downloading options.
* You can select which transects from which markers you'd like to plot
* If using a NetCDF file you can select which variables and Z values you'd like to see your selected transects plotted from.
* If using a NetCDF file with a Z dimension you can plot an image of a single transect taken over all Z values of your dataset.
5. You can save the current plot to .PNG or .PDF formats. You can also save the currently selected data or the currently selected data over all Z variables to a JSON file (see "Data Output" section of the [docs](https://cutview.readthedocs.io/en/latest/data_output.html) for more on how data is formatted).
* If you want to continue working on your project at a later time, select all the transects and save the data to JSON format. Refer to section below for reloading that data.
6. Click anywhere around the popup or the close button to dismiss
#### Uploading a project
1. Load the same dataset/image you worked on previously.
2. Hit the "Transect Marker" button to enter transect mode.
3. Instead of clicking new points, select the "Upload Project" button.
4. Enter the file name of the transect data you saved previously and select "Ok".
5. All markers from the file will load onto the viewer and you can continue working on the project.
Raw data
{
"_id": null,
"home_page": "https://github.com/rchartra/CutView",
"name": "cutview",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": "NetCDF, GUI",
"author": "rchartra",
"author_email": "rchartra@uw.edu",
"download_url": "https://files.pythonhosted.org/packages/8e/b4/89cd15429c65c7f9ec382913ec76efe7afe1c4a105777c71a8a7f47d65ee/cutview-0.2.10.tar.gz",
"platform": null,
"description": "# CutView\nCutView is a GUI for getting pixel data from images and data values from NetCDF files along a linear transects. This simplifies the analysis of satellite imagery or other images with linear features where the brightness of the pixel can be used to gauge some physical value. Examples include measuring sea ice floe concentration or characterizing ice sheet fractures. For NetCDF files, CutView serves as an easy way to view datasets quickly along any dimensions and extract data along transects. CutView is designed to make the measurement of linear features as automatic as possible through \u201cmarker\u201d tools where linear features can be marked out and have transects automatically be made across. Multiple features can be marked at once on a file and saved all together as a \u201cproject\u201d that can be reuploaded and continued or edited.\n\n\n![](images/cutviewgraphic.png)\n\nUsers can display a plot of the data as well as package the data into a downloadable JSON file. When extracting values from the image/dataset, the program uses linear interpolation to interpolate between the values of the pixels to ensure the most accurate portrayal of the line drawn. \n\nPlease refer to the repo wiki for installation and usage instructions. This is an open source project. For contribution guidelines please refer to the contribution section of the [docs](https://cutview.readthedocs.io/en/latest/contribution.html).\n\n# Installation Instructions\n\n## Linux and Mac\n\n1. It is recommended to first create a virtual environment (if your IDE does not do it for you) before installing packages on your system to prevent package compatibility issues. From the terminal at your desired directory use:\n```\npython3 -m venv venv\nsource venv/bin/activate\n```\n2. Then install CutView using PIP:\n\n```\npip install cutview\n```\n3. To run the app execute the following Python code:\n```\nfrom cutview.cutview import CutView\nCutView().run()\n```\n4. To exit virtual environment when finished:\n \n```\ndeactivate\n```\n\n5. To open the same virtual environment again in the future simply execute:\n\n```\nsource venv/bin/activate\n```\n\n## Windows\n\n1. It is recommended to first create a virtual environment (if your IDE does not do it for you) before installing packages on your system to prevent package compatibility issues. From the terminal at your desired directory use:\n```\npython3 -m venv venv\nvenv\\Scripts\\activate\n```\n2. Then install CutView using PIP:\n\n```\npip install cutview\n```\n3. To run the app execute the following Python code:\n```\nfrom cutview.cutview import CutView\nCutView().run()\n```\n4. To exit virtual environment when finished:\n \n```\ndeactivate\n```\n\n5. To open the same virtual environment again in the future simply execute:\n\n```\nvenv\\Scripts\\activate\n```\n\nIf you are having trouble installing CutView please refer to the Troubleshooting section of the [docs](https://cutview.readthedocs.io/en/latest/installation.html)\n\n# Usage Instructions\n\n* If you would like to try out the app there are example image and NetCDF files in the [support](https://github.com/rchartra/CutView/tree/master/support) folder of this repository\n * Relative file paths:\n\n `support/example.jpg`\\\n `support/test_img.png`\\\n `support/example_4v.nc `\\\n `support/example_3d.nc`\\\n * There is an example project file for upload as well:\n\n `support/example_markers.json`\n\n\n\n## Running app\n\n1. To install the app, refer to installation instructions for your OS\n2. Execute the following python code:\n```\nfrom cutview.cutview import CutView\nCutView().run()\n```\n\n## Loading a file\n\n1. To load image file or NetCDF file type the relative or absolute file path into file entry text path and select \"Go\"\n * If you are loading a NetCDF file a popup window will appear with additional selections:\n * Select which variable from your file you would like to see.\n * Confirm or select which dimensions you would like to use as the X and Y axes for your variable.\n * If your variable has data in a third dimension select the Z dimension and an initial Z value to display. You will be able to toggle between z values later.\n * Select \"Go\" to load the selected data\n\n\n2. You can scroll to zoom in and out of the image and can click and drag the image to move it around.\n3. From the \"View\" menu in the settings bar you can rotate or flip the image as well as change graphic settings for the tools.\n4. If you are loading a NetCDF file, from the \"NetCDF\" menu in the settings bar you can change which variable or z value you'd like to see as well as change the color map or contrast of the image.\n\n## Tools\n* To clear widgets from the viewer at any point click any of the tool buttons\n### Transects\n* This tool will make multiple transects between two points\n\n1. Hit \"Transect\" to enter transect mode\n2. Click two points you'd like to make a transect between\n * Select \"Drag Mode\" from the actions sidebar to drag the image without selecting points, and select \"Transect Mode\" to go back.\n * Select \"Edit Mode\" to delete either the last point clicked or the last transect drawn.\n3. Repeat for as many transects as you'd like\n4. When done select the \"Plot\" button and a popup will appear with a plot of all transects and downloading options. \n * You can select which transects you'd like to plot\n * If using a NetCDF file you can select multiple variables and Z values you'd like to see your selected transects plotted from.\n * If using a NetCDF file with a Z dimension you can plot an image of a single transect taken over all Z values of your dataset. To use this option only one transect can be selected.\n5. You can save the current plot to .PNG or .PDF formats. You can also save the **currently selected** data or the currently selected data over all Z variables to a JSON file (see \"Data Output\" section of the [docs](https://cutview.readthedocs.io/en/latest/data_output.html) for more on how data is formatted).\n6. Click anywhere around the popup or the close button to dismiss plotting window.\n\n### Marker\n* This tool allows you to click along a feature and have transects automatically made perpendicular to the feature. \n* You can mark out multiple features and save them all together as a single \"project\". \n* You can upload previous projects to edit or continue them.\n\n#### Working on a project\n\n1. Hit the \"Transect Marker\" button to enter transect mode\n2. Click points along the feature you'd like transects of. Dots will appear on either side of the line drawn indicating the start and end of the transects that will be made\n * Select \"Drag Mode\" from the actions sidebar to drag the image without selecting points, and select \"Transect Mode\" to go back.\n * Select \"Edit Mode\" to delete either the last point clicked or the last marker drawn.\n * To change the width of the transects being made you may enter the number of pixels into the \"Width\" text box. Select \"Go\" to change the width for all future transects.\n * This will not change the width of transects already drawn\n * The default width is 40 pixels, you can enter any width within 0 and 400\n * If you change the width of a marker any new markers will continue to use that same width unless you change it again.\n3. Select \"New Line\" to begin a new marker and repeat for as many markers as you'd like\n4. When done select the \"Plot\" button and a popup will appear with a plot of all transects from the first marker and downloading options. \n * You can select which transects from which markers you'd like to plot\n * If using a NetCDF file you can select which variables and Z values you'd like to see your selected transects plotted from.\n * If using a NetCDF file with a Z dimension you can plot an image of a single transect taken over all Z values of your dataset.\n5. You can save the current plot to .PNG or .PDF formats. You can also save the currently selected data or the currently selected data over all Z variables to a JSON file (see \"Data Output\" section of the [docs](https://cutview.readthedocs.io/en/latest/data_output.html) for more on how data is formatted).\n * If you want to continue working on your project at a later time, select all the transects and save the data to JSON format. Refer to section below for reloading that data.\n6. Click anywhere around the popup or the close button to dismiss\n\n#### Uploading a project\n1. Load the same dataset/image you worked on previously.\n2. Hit the \"Transect Marker\" button to enter transect mode.\n3. Instead of clicking new points, select the \"Upload Project\" button.\n4. Enter the file name of the transect data you saved previously and select \"Ok\".\n5. All markers from the file will load onto the viewer and you can continue working on the project.\n\n",
"bugtrack_url": null,
"license": "GPL-3.0-or-later",
"summary": "CutView is a GUI for getting pixel data from images and data values from NetCDF files along linear transects.",
"version": "0.2.10",
"project_urls": {
"Documentation": "https://cutview.readthedocs.io/en/latest/index.html",
"Homepage": "https://github.com/rchartra/CutView",
"Repository": "https://github.com/rchartra/CutView"
},
"split_keywords": [
"netcdf",
" gui"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d42cef18661428d5ce6d4ebeca1b0ed10e54fd398739f054db350c095e72ac69",
"md5": "5699b4a2e820ec21a306c957a327ebec",
"sha256": "d4d89e0ddc16045dba14dae3e70faf032c2df9af3ece3f12c324a6d7c56f6312"
},
"downloads": -1,
"filename": "cutview-0.2.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5699b4a2e820ec21a306c957a327ebec",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 56148,
"upload_time": "2024-07-11T16:13:03",
"upload_time_iso_8601": "2024-07-11T16:13:03.786728Z",
"url": "https://files.pythonhosted.org/packages/d4/2c/ef18661428d5ce6d4ebeca1b0ed10e54fd398739f054db350c095e72ac69/cutview-0.2.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8eb489cd15429c65c7f9ec382913ec76efe7afe1c4a105777c71a8a7f47d65ee",
"md5": "dc509683f97ee28d35a380710ff39fb1",
"sha256": "58334ec6c45a7cdb2a39896435ec183aa9b040a7a434bd12613a6b0eabded51a"
},
"downloads": -1,
"filename": "cutview-0.2.10.tar.gz",
"has_sig": false,
"md5_digest": "dc509683f97ee28d35a380710ff39fb1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 50248,
"upload_time": "2024-07-11T16:13:05",
"upload_time_iso_8601": "2024-07-11T16:13:05.659176Z",
"url": "https://files.pythonhosted.org/packages/8e/b4/89cd15429c65c7f9ec382913ec76efe7afe1c4a105777c71a8a7f47d65ee/cutview-0.2.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-11 16:13:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rchartra",
"github_project": "CutView",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "cutview"
}