How can I create a vtk structure point file from vtk unstructured grid file? - visualization

I have an unstructure grid in vtk file ( with legacy format), these file describe a points, cells and cell type. How can I generate a vtk structured point from this unstructure grid ?, or a 3d image file (with voxel information)?

You can start converting your vtkUnstructuredGrid to a vtkPolyData, see an example here . Then you can use vtkImplicitModeller to build a vtkImageData (voxels) from your vtkPolyData, see an example here . These are C++ examples, I'm sure you can find Python examples if needed.

Related

How to visual a 3D bathymetry data in Paraview

I want to display a 3D bathymetry data in paraview, the file datatype is netcdf:
it has two dimensions and three variables;
my netcdf file format
When I try to open it in paraview: it is a 2D not 3D,
2D
I want to display Dlike this:
3D
i’m sorry for bad English and less infomation.
The most simple way to do that is to use the Extrusion Surface representation.
https://blog.kitware.com/a-new-embossing-representations-plugin-for-paraview/
Open ParaView
Tools -> Manage Plugins -> Embossing Representations
Create a new view
Open your file
Switch representation to Extrusion Surface
Only Available since ParaView 5.6.0. Keep in mind this is only a representation, not a change to the actual data. If you want to change the data, you will have to use CellDataToPointData and WarpByScalar, which will require more tweaking.

How to export view to a vector image format in Netlogo

I would like to export the exact view of agents layout (including their shapes and colors) into a vector image file format such as EPS, PDF, SVG,...
Is there any way to do that without vectorizing the generated PNG files with another application?
EDIT 1:
I tried to write an extension as Seth recommended, but the generated image is as follows:
Generated Image of the extension
EDIT 2:
The problem was with the vector library I was using. Changing the library, the extension works like a charm!
A new extension is built to export the view of model to a vector image file. The supported formats are EPS, PDF, and SVG.
You can find the source and the built files here:
https://github.com/aesmaeili/vectorview
Great question! Sadly no, this is not supported in stock NetLogo. It should be; I wish it were!
SVG would be an excellent choice of output format.
Someone with some knowledge of Java or Scala coding could write a NetLogo extension that does this, by recording the Java2D calls that the NetLogo renderer makes, using a library such as https://xmlgraphics.apache.org/batik/using/svg-generator.html.

Convert dicom .dcm files into .obj format

I have sets of .dcm files of an MRI scan. I am trying to convert them into 3d formats like obj (preferably) or fbx to import them into Unity 3d. I used the following open source software dcmtk to convert .dcm file into text file.
Converting DICOM files to text files
However, the dcm files lack the needed information. Is it even possible to convert .dcm files to obj and fbx. if so, could you suggest something?
Thanks
(Edit)
I would like to put my question more precisely: I want to visualize MRI data as a 3D model in Unity 3d. This is possible only when I it stored as .obj or .fbx format. Which format of MRI medical data should I start with to convert to these formats?
Thanks
According to your previous comments you are looking for the necessary information in order to obtain the geometrical information of a DICOM series representing volumetric information (RM, TC, PET, ...)
In this case, you should have a look at the Roni Zaharia web site where he explains very clearly the concepts related to orientation and geometry of the DICOM images: DICOM is easy: Getting oriented
In this particular page you will find information about Pixel Spacing, Image Orientation, Image Position, Slice Thickness, and Slice Location, as well as additional information references.

How can I print out a large table of symbols from MATLAB to form a cross-stitch chart?

On this website, one can create stitch charts from images. I'm trying to do this in MATLAB. I have implemented everything using the Image Processing Toolbox (Reducing of number of the colors, mapping to the color space of available yarn colors). I'm done with all of this, the only thing I still need to do is to create an output similar to these files from MATLAB, which basically show which yarn to use for each raster point of the stitch chart:
BW
Color
My question is how to print a table with a lot of very small fields with the color and/or symbol inside.
It should look somehow like in these PDF files. How can I print out a table like this? Directly from MATLAB? Can I create a PDF file like this in MATLAB? Should I export it to Excel somehow?
For the "color" PDF you linked, this looks just like a pixelated image. Why don't you save each "field" as one pixel, for example in a TIF file using imwrite(I, 'filename')? You could then print this TIF into a PDF using an appropriate scaling factor to make the pixels large enough.
For the "BW" PDF which basically contains a large table of symbols, it would probably be easiest to go through HTML or RTF file format to get the table of symbols, and then use some html2pdf or rtf2pdf converter...

Using matlab to change the color of the polygons of a map from a shp file

My question is that how do I change the polygons of a map from shp file (shapefile) while using matlab. I was doing this project where i was given map in shpfile format that I need to use on, I am able to read the map in matlab but the map is divide in regions and each regions have its color, my problem I met was to change the polygons to its respective colors, anyone sees this please kindly help and reply me asap.
Are you using the Mapping Toolbox by The MathWorks, or third-party codes such as ones from the Shapefile C Library to import the shapefile? If you are using the Mapping Toolbox, I cannot be of much help here as I do not have that toolbox -- hopefully, someone else can help here.
In any case, if you could import the shapefile on to your MATLAB Workspace, you should be able to find the vector data (polygons and attributes data, etc.) somewhere...
If you do not see anything on the Workspace, possibly you can find those data in the Figure (or in the Axis).
data=get(the_handle);
I would look for the data there.
After you obtain the polygon and properties data, you can patch/fill them with any color you like (based on any other information you find there.)
Good Luck