06-08-2011 01:58 PM
I am trying to create a more efficient and programmer friendly way to circular crop an intensity graph. Currently I can crop the graph with a matlab script but am trying to improve the process. I would like to be able to tell where the image will be cropped before executing the command. My solution was to place an invisible plot with the same scale over the top of the graph that can draw a circle around the area to be cropped. As you can imagine lining these graphs up is annoying and doesn't lend itself to rearraging my vi. I am looking for a better way to draw a circle/tell where it will crop beforehand.
Solved! Go to Solution.
06-09-2011 03:40 PM
What exactly do you mean by a circular crop? Could you clarify?
06-09-2011 05:01 PM
Here is a relatively simple method using the PlotImage property and a cursor.
06-27-2013 03:57 AM - edited 06-27-2013 03:58 AM
Okay it hasn't been long since I started, can you teach me how I can find out what each component is from the snippet you uploaded?
06-27-2013 06:38 AM
The Context Help window is the place to start. As you move the cursor over each node a brief description appears in the help window. For most things a link to Detailed Help is at the bottom of the window.
I highly recommend that you keep the Context Help window open at all times when you are programming. If you have a small screen there may be times you need to hide it, but keeping it open more than closed should be your goal.
Lynn
06-27-2013 06:47 AM
Ah ok thank you so much
06-27-2013 07:11 AM
Is it possible to use this to crop any image in a circular form?
if so then where do I connect the image source?
06-28-2013 07:39 AM
If you image is grayscale, you can continue to use the intensity graph. Read the image using one of the Read * file.vis in the Graphics Formats palette (or you can search the palettes or use Quick Drop to find the VIs fast). Use Unflatten Pixmap.vi to convert the graphics cluster to a 2D array of intensities. For grayscale, you usually will want to use the 8-bit output. Wire this to the intensity graph.
Alternately, you can use a picture control instead of the intensity graph. Use Draw Flattened Pixmap.vi to draw the image you read from file to an image control data type. Then use the draw circle VI in the previous example to draw a circle on top of it. Now write this to a picture control. You will need to change the event structure to use the picture control instead of intensity graph, but the picture control has all the same hooks, so it should be relatively straightforward. Let us know if you run into issues.