Convert volume to STL file? - xtk

I pulled the rep from XTK/K. Now I am able to load my created NII files into the slicer with the thresholding method. Now I am able to threshold my pixel data within the volume object. Is it possible to convert the thresholded volume which is rendered into a STL file or similar? Can write such a file to the system?
Thanks in advance
regards Stefan

Related

Histogram for big data set

I want to draw histogram for 1GB data using map reduce. Not able to get any hold after googling. Please give suggestions for any specific library in python or java.
ValueHistogram in hadoop can be used for drawing histogram.
https://hadoop.apache.org/docs/stable2/api/org/apache/hadoop/mapreduce/lib/aggregate/ValueHistogram.html

How to set classification colors in GDAL output files

I am using the GDAL C++ library to reclassify raster map images and then create an output image of the new data. However when I create the new the new image and open it, the classification values don't seem to have a color defined, so I just get a black image. I can fix this by going into the image properties and setting a color for each of the 10 classification values I'm using, but that is extremely time consuming for the amount of maps and trials I am doing.
My question is, is there a way to set metadata info through the GDAL API to define a color for each classification value? Just the name of the right function would be great, I can figure it out from there.
I have tried this using ArcGIS and QuantumGIS, and both have the same problem. Also the file type I am using is Erdas Imagine (called "HFA" in GDAL).
You can use SetColorTable() method on your raster band. Easiest to do is to fetch one pre-existing raster using GetColorTable(), and pass it to your new raster.

volume image data in the XTK toolkit

I have read here:
Is there a way to use a Custom cross-sectional slicer of 3d image data?
... that the nrrd parser stores the image data as a 3D array. I want to be able to access this array in my scripts. How can this be done? I would like to use this data to do image statistics, and subsets to do region of interest statistics. I believe the data is a private variable which is just used by the slice function to create the volume slices, is that correct? If so how can I save it for later use as a public variable, or as a property of the volume object?
Please explain as simply as possible how to proceed as I am quite a novice at javascript.
Many thanks,
We didn't store the array for all volume parsers yet to slim down the memory usage. This can certainly be added since the infrastructure is there under the hood.
I assigned the issue to me
https://github.com/xtk/X/issues/84

How can I process an image?

I'm building a program to convert an image file (whatever file type would be easiest) to G-Code for use on a rep-rap with a pen plotter attachment.
I'm wondering if i wanted to process the image pixel by pixel and check things like pixel color, how could I do this with C++?
I would really like to know how I can process a bitmap image, pixel by pixel, to check the color of the pixel.
The best way is to use a library, like for example Magick++.
When you load an image, you can access it's pixels data with Blob
You will probably want to use an existing library that has been tested.
But for fun/practice/etc, this would be a good exercise and wouldn't be impossible to do. The Bitmap Format is (relatively) simple compared with other image formats. The Wikipedia page has some tons of info, including some C++ code. It looks like once you've gotten past the header information, you get to a pixel array that shouldn't be difficult to parse.
Good luck.
Most image formats consist of a header and the actual raw image data. A bimpap image is no different. If you don't want to use one of the existing libraries, or if you are not allowed to, you should read about bitmap format :
http://en.wikipedia.org/wiki/BMP_file_format
Once you understand this you could create appropriate structs/classes to store the information you want from the header such as x,y size, bpp etc. And also have a pointer to the raw image data. You could then simpy iterate through every pixel and do whatever you want with it :)
Once you decipher the image file, I suggest you place the pixels into a matrix, for the first pass. (Future revisions can use other methods to access the pixels).
You can apply transformations to the pixels by using matrix multiplication. You can also access the pixels individually by using array indexing.
Search the web and SO for "introduction to graphics c++".

stitching aerial images to create a map

I am working on a project to stitch together around 400 high resolution aerial images around 36000x2600 to create a map. I am currently using OpenCV and so far I have obtained the match points between the images. Now I am at a lost in figuring out how to get the matrix transformation of the images so I can begin the stitching process. I have absolutely no background in working with images nor graphics so this is a first time for me. Can I get some advice on how I would approach this?
The images that I received also came with a data sheet showing longitude, latitude, airplane wing angle, altitude, etc. of each image. I am unsure how accurate these data are, but I am wondering if I can use these information to perform the proper matrix transformation that I need.
Thanks
Do you want to understand the math behind the process or just have an superficial idea of whats going on and just use it?
The regular term for "image snitching" is image alignment. Feed google with it and you'll find tons of sources.
For example, here.
Best regards,
zhengtonic
In recent opencv 2.3 release...they implemented a whole process of image stitching. Maybe it is worth looking at.