Visaulize several .vtk files together in Paraview - matlab

I am running some simulations on Matlab and then passing them to Paraview using .vtk files. I would like to see all three .vtk files together in Paraview screen but it seems like I can visualise them only one by one, not together.
Anyone knows how to solve this?
Thanks in advance.

It's possible to visualize several .vtk files together in Paraview.
Just hit "Ctrl+O" and select the files you want to visualize.
After that you have to hit apply in any of the loaded files in order to update the pipeline.
Watch out for naming!
If you name your files like:
file1.vtk
file2.vtk
file3.vtk
They will be loaded as a TimeSeries and visualized as an animation. One at a timestep.
Hope it helped!

With ParaView 5.3, you can apply the Group TimeSteps filter, to group all the timesteps into a single multiblock dataset with each timestep added as a separate block.

Related

How to remove multiple ROIs in the same general area on Fiji

I am wondering if anyone knows how to delete multiple ROIs in the same general area of an image. I'm using Fiji.
I am looking for an easy way to delete all ROIs in a given area. For example, the multi-point selection tool has the ability to delete all points within a given selection. I would like to find a function like this but for ROIs.
I have many images like the one below (>100) with ROIs labelling cells. I only want ROIs to label cells in a certain region of the image (the barrel cortex) and would like to get rid of all other ROIs.
Would someone have an idea of how to write a macro to perform this function?
Any help would be greatly appreciation.
Thanks!

ParaView: display director

I'm trying to display liquid crystal directors using ParaView. The director is a spin-2 field that should look like a headless vector, centred in the middle, like the cylinders in this picture:
https://pbs.twimg.com/media/C8fj1bWXoAEFy5R.png
I know how to make an arrow filter, like this other picture, but it's not what I want:
https://summerofhpc.prace-ri.eu/wp-content/uploads/2013/07/arrows.png
I can't find the filter that will do what I need. Could you please tell me if I need to create a custom filter or if there's a quicker way to obtain this result within ParaView?
My data are expressed as 3D vectors within a VTU (unstructured grid) file.
Thanks in advance and sorry for the newbie question!

exporting svg image from matlab surface plot

I need some to produce some publication-quality figures. I first export the figures from matlab in .svg format, and then I do some post-processing in inkscape. I am no problem with figures generated using plot or scatter, but when I export figures generated using surf (in view(2)), I run into problems. If I use plot or scatter, I am able to ungroup and process various parts like the title, axes, scattered points, lines, etc. in inkscape. For surf, however, matlab just exports one single figures with all various parts grouped into one single unit. I can't separate individual part, and when I zoom very close I can actually see the bitmap resolution for the axes and titles (if I use plot, the titles and axes have 'infinite' resolution when I zoom very close). I am fine with the surface plot having finite resolution, but I need to at least be able to process the axes and titles (which I currently cannot do). What should I do so that I can 'separate' the title and axes from the main plot, just like figures generated from plot and scatter?
I stumbled across this question, since I encountered the same problem.
As mentioned by #vindarmagnus, it is possible to use tikz and get rather nice results. However, tikz experiences problems with large data sets in my experience as present when using surf etc..
Solution, that worked for me:
Change the renderer to painters and the exported .svg file will retain its vectorgraphic properties when opened e.g. in inkscape:
figure('Renderer','Painters');
I used to use Inkscape for my scientific publications as well, but I found that a lot of the time you can get better results with pgfplots in latex, together with the matlab2tikz matlabscript. There’s a ton of resources about this online, but here’s how my workflow would look adopted to your surf situation. I have macOSX with latex, matlab and matlab2tikz installed. Will work with little to no modifications on linux.
In Matlab:
surf(peaks(25))
matlab2tikz('plot.tikz’)
Then I have the following bash-script (just a script in the same folder as the image, which is executed by mere double-click). (Needs to be chmod-ed as an executable for that).
#!/bin/bash
cd ~/Desktop
rm *.eps
cat > plot.tex << EOF
\documentclass{standalone}
\usepackage{pgfplots}
\pgfplotsset{max space between ticks=50}
\pgfplotsset{scaled ticks = false}
\pgfplotsset{compat=1.6}
\pgfplotsset{xticklabel style={/pgf/number format/fixed}}
\pgfplotsset{yticklabel style={/pgf/number format/fixed}}
\begin{document}
\input{plot.tikz}
\end{document}
EOF
pdflatex plot.tex
pdf2ps plot.pdf
ps2eps plot.ps
Note that the row cd ~/Desktop above should be changed as to reflect which folder the script is supposed to be run from (a bit crappy, but needed since Finder doesn’t properly pass along the folder from a program is executed, afaik).
This yields high-quality images in eps or pdf or what you like, with a ton of settings for axes and ticks etc. And it all uses native latex fonts.
Edit:
Recently I’ve begun to use patch() in matlab and then export it to tikz in the same manner as above, with great results. That’s another suggestion!
You can use also:
set(gcf,'Renderer','Painters')

How to use markers in MatLAB

I need to plot some results in Matlab. Using plot3 worked just fine, one problem did occur, though.
I use the following
plot3(x,y,z,'-rv')
How can I change the above code, so the markers appear on one, last, node only?
Any help would be much appreciated.
--
grnspn
You can plot using two separate commands:
plot3(x,y,z,'-r')
hold on
plot3(x(end),y(end),z(end),'rv')

How to manually segment and label ROIs in an image in Matlab?

I'm a newbie to Matlab. I'm basically attempting to manually segment a set of images and then manually label those segments also. I looked into the imfreehand(), but I'm unable to do this using imfreehand().
Basically, I want to follow the following steps :
Manually segment various ROIs on the image (imfreehand only lets me draw one segment I think?)
Assign labels to all those segments
Save the segments and corresponding labels to be used further (not sure what format they would be stored in, I think imfreehand would give me the position and I could store that along with the labels?)
Hopefully use these labelled segments in the images to form a training dataset for a neural network.
If there is some other tool or software which would help me do this, then any pointers would be very much appreciated. (Also I am new to stackoverflow, so if there is any way I could improve on the question to make it clearer, please let me know!) Thanks!
Derek Hoiem, a computer vision research at the University of Illinois, wrote an object labelling tool which does pretty much exactly what you asked for. You can download it from his page:
http://www.cs.illinois.edu/homes/dhoiem/software/index.html