How to use the polygon tool in ITK SNAP for 3D/voxel? - itk

I know the paintbrush tool can segment out voxel 3D volume but how do I do this with the polygon tool? I want all slices to have the save segmentations.

You can accomplish that by drawing your polygon on the first slice, accepting it, scrolling to the last slice, "paste last polygon", and then using Tool menu, option Interpolate Labels. Default options should give you the desired result.

The polygon tool is used to paint closed polygons on top of the axial, sagittal and coronal slice windows.
These polygons are then filled with the currently selected label. By painting polygons slice by slice, a whole 3D structure can be selected.
Click the left mouse button somewhere on the boundary of the right caudate.
Continue clicking the left button along a sequence of points along the boundary.
Click the right mouse button to close the polygon.The green rectangle around the polygon indicates that all of the vertices are currently selected. Selected vertices can be moved by clicking and dragging the left mouse button. Let's select some vertices and move them:
Use the mouse to draw a box around some of the vertices in the polygon (to draw the box, click and hold the left mouse button near the upper left part of the slice window, drag the mouse towards the lower right corner and release the button once the box contains two or more vertices).
Click and hold the left mouse button inside the green box and drag it to move the selected vertices.
In addition to selecting vertices and moving them, you can use the buttons located under each slice window to manipulate the polygon. Use the 'delete' button to delete the currently selected vertices from the polygon. Use the 'insert' button to insert new vertices between adjacent pairs of selected vertices.
Edit the polygon by selecting, moving, deleting and inserting vertices until you are satisfied with it.
Use the 'accept' button to fill the polygon with the segmentation label 'caudates'.
Once you have clicked 'accept', the voxels inside of the polygon are assigned the currently selected segmentation label.
If you are not satisfied with your result and want to erase it, you can do so by changing the active drawing label to the 'Clear' label, and painting a polygon on top of the part of the segmentation that you want to erase. When you press 'accept', the voxels withing this polygon will be assigned the clear label.
SNAP remembers the last polygon that you used and lets you paste it. This makes segmenting a structure faster.
Move to the next slice in the slice window where you just painted (using the scroll bar or the mouse wheel).
Press the 'paste' button to recall the last accepted polygon.
Edit the pasted polygon by selecting and moving vertices, and accept it when satisfied.

Related

How to zoom a leaflet map depending on the latitude and longitude

I want to show a popup window where i am going to show a leaflet map. In the popup window i'll show the path between two points. These two points are two [lat,lon] pairs
Point A is [lata,lona], Point B is [latb,lonb]. I want to set the view or or zoom level of the map so that the map is zoomed focusing the distance between point A and Point B. That means the map will have point A at near of one end of the map and point B at near of other end of the map. How can I do it. I am now using the following command to setview to to Point A and point A remains at middle. Here is my command
map.setView([A[0],A[1]],14);
So the point A is at the middle but the point B sometimes go even outside map. I want both A and B to be shown at map and the farthest distance within the map.
Use the fitBounds method instead of setView if you want to focus the map to an area rather than a point.

Find marker with in the shape or outside the shape drawn by polyline on google map?

I am drawing shape with polyline on Google map. When I get finish with drawing I click within boundary of shape which drawn on Google map and get LAtLng. I just want to find out either I click within shape drawn or outside the shape. For example if I draw the circle on map and if I click inside the circle it show me I click inside the circle or if I click outside the circle it show me I click outside the circle. I just want to get same thing with polyline shape.
Add click-listeners to the shapes, when the listener for a shape fires the click happens on the shape, when it fires for the map, it has been outside of a shape.

How to ignore (or not get) clicks on interior of unfilled polygon

Anyone know of a way to make it so that my click handler is not called or if called can determine that click was on interior of unfilled (or fillOpacity of 0) polygon? (Polygon is NOT editable so path and vertex will not be included in click event)
I want to ignore such clicks and allow click to "bleed" through polygon, I only want to process clicks on polygon outline.
I suppose I could do something with the latlng of the click to determine if it is more then some number of pixels from an edge but that seems way to complicated, especially if strokeWeight and zoom levels need to be taken into account.
(I often have custom markers inside the polygon that I render myself by subclassing OverlayView and want to process clicks on them instead in such a case.)
Thanks
Setting clickable to false on the PolygonOptions didn't fix the issue? If not, try using a Polyline instead of a Polygon. Then you don't have to worry about clicks in the middle.

How to disable polyline click on overlays?

I've dispatched mouse over events on polylines. This event is fired even when I mouse over on an overlay which is on the polyline. How can I avoid it so the overlay actually hides the polyline under it?
The simplest approach is probably just to set the Polyline's clickable property to false when you add the other overlay (which I'm assuming is a custom overlay). Then, the Polyline won't respond to mouse events at all, if that is your goal. For that, you simply pass a PolylineOptions object to the Polyline constructor, or call the Polyline.setOptions function and pass a PolylineOptions object, if you want to make the change dynamically after construction.
If you want something with more fine-grained aspects, such as taking full control of the stacking order of overlays, you will want to look into the MapPanes. There are seven panes, which are essentially layers where overlays may be added to the map. From bottom to top, they stack in this order:
MapPanes.mapPane
MapPanes.overlayLayer
MapPanes.overlayShadow
MapPanes.overlayImage
MapPanes.floatShadow
MapPanes.overlayMouseTarget
MapPanes.floatPane
Since you are trying to cloak even the mouse events of the Polyline, you will probably have to place your other overlay at the top, on the floatPane. I do this for some of my InfoBoxes, which function as rectangle map label boxes. My goal was to put them above everything else on the map and they do appear above everything else (the map, markers, overlays, etc.).

Draw area/polygon and retrieve coordinates with google maps

Is there any tool that can help me with getting the coordinates for a specific area/polygon?
I usually use Google Earth.
Draw a polygon, then move the mouse over and right click > copy.
Then you can paste it in the notepad and you will find the coordinates there (remeber the format (long, lat,n) the reverse of Google Maps format.
You can also use online tools to format the information or remove parts.
http://www.earthpoint.us/Shapes.aspx
So the idea is to have a map, draw a polygon on it (I assume by placing the vertexes) and then getting the coordinates of the vertexes?
You can make markers draggable when you create then. You can also get the lat/lng position of the markers when certain events fire: the 'dragend' event, for instance.
With these tools, you have the basics of your requirements here. Make a button that places vertexes on the map - just use a marker with custom graphics - and let the user drag the vertex to whatever position they need. Record the new position of the vertex whenever the dragend event fires. Draw lines on the map between the markers, to show to the user the area selected. Have a button to 'complete' the shape, linking the last vertex up with the first vertex.
There may be some existing code to do this, but I am not aware of it. However, it should be possible to throw something together with a bit of work.