Is there a way to use a Custom cross-sectional slicer of 3d image data? - xtk

I mean, is there a way to use the current slicer to show a sectional slice (not aligned with the canonical Axis) of the 3D image data? or better, a sectional slice of a predefined size.
If there is no exists, how can I contribute with this ??
Regards,
P

currently this is not possible but you are very welcome to contribute.
the parsers of NRRD and MGH/MGZ format store a 3D array of the image. All X.slices are configured using a front and an up vector.. now we only have to link the X.slice to grab the right values from the 3D array and then create a widget so it is possible to reslice/reformat on the fly. Sounds good?

Related

how to remove glyphs from vtk data?

I am wondering if there is a vtk filter that replaces glyps (cone source) with a single vertex?
Here is the problem i am trying to solve. I have bunch of vector field data displayed using cone glyps. I am trying to pick a vector glyph and display vector values. I am using vtkCellPicker to pick the vector glyph. The cell picker is picking the face on the glyph instead of picking the whole glyph. So, the vector values picked are values on the face, not for the entire glyph.
If i can run the vtkData through some filter which replaces these glyps with a single vertex, i can pick the point and pick the correct vector field values.
Any help is appreciated.
You can use a vtkPolyDataConnectivityFilter (http://www.vtk.org/doc/nightly/html/classvtkPolyDataConnectivityFilter.html#details) to pull out the whole glyph starting from the one cell that is picked.
You may be better off setting GeneratePointIdsOn on your vtkGlyph3D filter which will add to the cone data an extra array with input point IDs. You can then use this to look up the original data value for display. See http://www.vtk.org/doc/nightly/html/classvtkGlyph3D.html#a1d7bfd7779ca2e229423a33a2e36e741

Show 2D point cloud in PCL

I have a 3D point cloud representing a sewer. What I need is to convert this 3D into 2D using cavalier projections and once done that show the 2D representation. Each point represent a place inside a sewer. I mean, a laser was used to detect the sewer and several points (6470) were produced during the scan of the sewer.
I have converted them into 2D and stored into a vector of pairs of double. What I want now is to show them into my MFC application, maybe using a bitmap.
I don't know if using a vector of pair of doubles is the best option or if a bitmap is the way to achieve this problem. Any kind of suggestion will be helpful.
Thank you!

Draw zones instead of of points on an radar image

I don't really know how to explain it in a better way, so please look at the following images :
This is what I create for the moment
This is what I whish to create instead
I am currently using C++ with Qt 4.8.
Do you know a way that would allow me to reach my goal ? Using a library or a transformation matrix ? Or something else ?
I am a total newbie to image manipulation, so every advice is precious for me.
Thanks
EDIT :
I draw each colored pixel from Lat/Long measures, if it can help.
Use what is called a morphological operator. In this case, you would require the 'open' operator. OpenCV provides a pretty good implementation (and documentation of these) which can be found here.
Draw circles instead of points is all I can think of. Creating a triangle mesh is tricky with the concave elements of the distribution.
EDIT: Just looked at the full size version of the image and wondered if the data set is stored radially? You could scan adjacent radial lines and try to match up the changes in value along each line to form a set of quads. There will be a large number of edge conditions to consider though.
EDIT2: Alternatively, form a uniformly distributed set of quads and interpolate the vertex colours.
you can start by increasing the size of the points,
you could create a triangle mesh by using a sweepline algorithm:
sort the points by lat
keep a subset sorted by long
when you add a point compare to the 4 adjacent points and add triangles to the "to draw" set (remove points too far away from the current lat as needed)
with opengl you can use an index buffer to hold which point should be drawn

how to query the database to return all zip codes with a given distance (ie 5 miles) from a given zip code using geopy

Hi frens I am using geopy to calculate the latitude and longitude. Now I want to get the list of areas given distance from a zipcode.How to get that?
Well, as I can see, geopy doesn't have any built-in capability to get a list of areas around some coordinates.
But you can use a workaround. Take your geocode and calculate coordinates (latitue and longitude). Then imagine a grid on the map with a cell size equal to area of the smallest one you need to find around your location.
Use geopy to get an area name belonging to the each cell corner of your grid. Is that ok for you? It will get you some kind of approximation because a grid is not a circle and you may miss some small areas. But I think in most cases the solution will work fine.
It is much easier to locate zipcodes inside a rectangle than in a circle so I would recommend that you approximate your problem by looking for zipcodes inside a given rectangle.
Here are answers to the question of how to get list of zipcodes in given polygone: Find zipcodes inside polygon shape using google maps api
Summary
You need geometry for each zipcode. Once you have that you need to be able to query it using database that supports geoquery. One such database is Google's Fusion Table and there is already a geometry data table for zipcodes available here: https://www.google.com/fusiontables/DataSource?docid=1AxB511DayCdtmyBuYOIPHIe_WM9iG87Q3jKh6EQ#rows:id=1
Here's the sample query for Fusion Table data.
Another approach is server side code using PHP and CSV data. Here's live demo: http://daim.snm.ku.dk/demo/zip/. The page also has download for code.
If you use any of above technique please make sure to upvote answers of original authors :).

OpenGL getting perspective pixel data

I am working with a 3D rendering of a large field containing various objects. My program views this field in perspective from a high point.
I need to access the pixel data of (only) a rectangle in the field as viewed from above. I have the coordinates of this rectangle in the field, and would like to:
(a) Find the pixels corresponding to my desired rectangle.
(b) (Ideally) write the corresponding pixel matrix to a file.
Does anyone know a simple way of doing this?
You could use something like gluPerspective to set your viewpoint to the desired rectangle, then render the scene, and use glReadPixels to get the result back. That will give you a rectangle of pixel values -- it'll be up to you to convert them to an image format of your choice.
If you just want a single, static picture that's probably the simplest way to go. If you need/want to do it more often (e.g., you really want something that looks like a video), you could consider setting it up to render to a texture or a frame buffer object. This will (at least usually) improve efficiency at the expense of extra complexity.