1

I have a 2D list which can be plotted as follows:

Image 1

enter image description here

Based on the plotted image, I would like to select some of the shapes on the image and extract the data for further analysis, for example,

Image 2:

enter image description here

Is there any interactive tool or function in Mathematica which can serve the purpose?

A sample data can be downloaded here: https://drive.google.com/file/d/1aY5Iq1eqhRuzJ2sQ7dtPZ3b5KONwhm58/view?usp=sharing

Many thanks in advance.

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
wkong
  • 321
  • 1
  • 7
  • 1
    Do you want to filter original data based on that selection or to crop an image to that selection. Since images are usually rectangular, what do you expect to extract based on a round selection? – Kuba Aug 21 '19 at 07:31
  • 1
  • I prefer to filter original data based on the selection. I want to make a statistical analysis of the selected region. About the round selection, the data near the edge doesn't matter a lot and nearest neighbor search (or other approximation) would be good enough. Thanks. – wkong Aug 21 '19 at 07:40
  • 1
  • 1
    If you click the image (within Mathematica), a toolbar will appear below. You can select a part of the image and create the corresponding mask using the "mask tool". – Szabolcs Aug 21 '19 at 08:26
  • 1
    I am guessing the pictures are obtained from input matrix using MatrixPlot. By "image" and "data" in "select some of the shapes on the image and extract the data " do you mean MatrixPlot[matrix] and the part of matrix corresponding to the marked shape or Image[MatrixPlot[matrix]] and ImageData for the selected part of Image[MatrixPlot[matrix]]? – kglr Aug 21 '19 at 10:26
  • No, I do not want to extract the selected image. I want to extract the data over the selected region. – wkong Aug 22 '19 at 06:21

1 Answers1

2

Is there any interactive tool or function in Mathematica which can serve the purpose?

If you click the image (within Mathematica), a toolbar will appear below. You can select a part of the image and create the corresponding mask using the "mask tool".

enter image description here

Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263