How to get nodal values in OpenFOAM? - paraview

I would appreciate knowing how I can convert the cell values given after the OpenFOAM solution into the ones on the grid points. Is there any direct command for such a thing or I should work with the sampling option?
Thanks a lot for your help.

When you open your case using Paraview/paraFoam, then the interpolated fields at the points (nodes) are already computed by Paraview:
Fields with an orange small circle are the point data, while the fields that have an orange cube icon are the data at the cell centers, i.e:
You can also see the values of the fields (points or cell) using the Spreadsheet view and export them as CSV:

Related

Change Shape Fill based on Shape Data in Visio

Wondering if someone can help me with what I thought was a simple Shapesheet issue.
I'd like the fill colour of a shape to change based on one of the shape data values. I thought I could do this easily:
FillForeground: If(Prop.Colour="Blue",XXX,YYY)
But this doesn't work? (Visio 2021)
I've 5 list values for the data and would like a different fill colour for each? Weirdly, I can see that the value does change based on the data selection, but the actual colour seen in on the page doesn't.
Obviously, I'm not much of a coder, just an enthusiastic meddler.
I've stuck at:
=IF(Sheet.3780!Prop.StringSection="Firsts",THEMEGUARD(MSOTINT(THEME("LineColor"),40)),THEMEGUARD(MSOTINT(THEME("AccentColor"),40)))
(The shapes to colour are within a group)
Thanks
Steve
Steve !
FillForeground: If(Prop.Colour="Blue",XXX,YYY)
But this doesn't work? (Visio 2021)
For compare strings in ShapeSheet you must use STRSAME function
Use syntax like this:
IF(STRSAME(Prop.color,"blue"),4,3)

How to get region of interest in images

I need to train R-CNN on my dataset. Above Image is an example in which first column contain path to that image and second column contain coordinates of bounded box(ROI). How to get those coordinates in matlab. As my dataset is large so how those coordinates can be extracted by pointing manually.
for example if i am training R-CNN foe stop signs then second column contain coordinates of bounded box containing stop sign in whole image.
I do not know which version of MATLAB you are running, but I'm assuming it is fairly new (R2017a and later). Also, by 'how to get the coordinates', I assume you mean 'how to determine' or 'how to assign' the coordinates.
I believe what you need to do is to use one of the image labeling Apps called
imageLabeler
to annotate rectangles in your training images. You either do this manually if that's amenable, or you need to use automation algorithms if you already have a detector that does something similar. See this page for more details:
https://www.mathworks.com/help/vision/ug/create-and-import-an-automation-algorithm-for-ground-truth-labeling.html
Once you have the results of labeling stored in a groundTruth object, you would need to use something like objectDetectorTrainingData to create the table you are looking for.
See https://www.mathworks.com/help/vision/ug/train-an-object-detector-from-ground-truth-data.html for more details.

Paraview visualization help ("density/mist" plot?!)

I am trying to visualize a data set (x,y,z,scalar) in comma separated values format. The style I want to recreate is something like a transparent 3d heat map. The value of scalar at coordinate (x,y,z) will determine the "mist density". No idea what the name of the style is. Links below give examples of what I mean:
https://www.paraview.org/wp-content/uploads/2014/04/densityoverlay.png
or
http://www.scidac.gov/Conference2006/speaker_abs/AhrensPic.jpg
Any references would be most useful as I am new to data visualizing.
Take a look at the Point Volume Interpolate filter with Kernel set to GaussianKernel.

Matlab clustergram: add color markers by column label

I'm using clustergram in the Matlab bioinformatics toolbox. I want to add color markers to certain columns, similarly to this, but I want to mark specific ColumnLabels (IDs) rather than specific clusters.
Anyone know of a way to do that?
Found it. Based on Kevin's excellent suggestion, I passed a structure with colors for ColumnLabelsColor, then set LabelsWithMarkers as true:
clustergram(mat,'Colormap', redbluecmap,'ColumnLabelsColor',s,'LabelsWithMarkers',true)
mat is my DataMatrix. s is a structure of 2 cell arrays, each with length of the number of columns: first array is ColumnLabels, second array is my defined colors.
By default, setting ColumnLabelsColor changes the color of the text of the labels. Setting LabelsWithMarkers to true adds a color marker between the label and the clustergram:
Thank you for the suggestion. I have just figured out this problem.
First step: construct a structure with 'Labels' and 'Colors'. These two cell array should in the same length.
Second step: set the clustergram object, parameter 'ColumnLabelsColor' with this structure.
Also, set 'LabelsWithMarkers' as true.
[This is my original code for your reference ]
https://i.stack.imgur.com/ZTQ1h.png

Calculating unique transformation for multiple images in folder

I'm currently working on an alignment script which aligns two images very well. Usually, I get a data set which contains over 50 images of cells. I normally calculate a transformation matrix (T) based on fluorescent beads. However, this T-matrix gave rise to polarization in unpolarized cells, indicating that the transformation is not optimal. Therefore I switched to another script, which calculates a T-matrix based on cells and not beads. This new T-matrix aligns almost perfectly for a fraction of the cells, but there is always a portion of the images which aligns not so good.
I would like to continue with the alignment on cells, because this script works much better than the alignment on beads. In order to have optimal T-matrix for each image, I would like to calculate unique T-matrices for each image couple. I'm not very skilled in Matlab so the solution I could think of did not work.
Below you can find the current script. It functions by creating variables of the images I want to align and assign them to im1 and im2 in the script:
function [T] = alim(im1, im2, Tstart)
%ALIM Determines the transformation between the cameras.
im3=im2;
if (nargin>2)
im2=imwarp(im2, Tstart,'OutputView',imref2d(size(im1)));
end
optimizer = registration.optimizer.RegularStepGradientDescent;
optimizer.MaximumIterations=500;
metric = registration.metric.MattesMutualInformation;
T = imregtform(im2, im1, 'affine', optimizer, metric);
if (nargin>2)
T.T=Tstart.T*T.T;
end
figure;
imshowpair(im1,imwarp(im3,T,'OutputView',imref2d(size(im1))));
end
I tried to incorporate a loop which imports all images from the folder sequentially and assign these to im1 and im2. However, the problems that arises is that the type of data changes from uint16 into cell, which can't be used for this type of transformation. One defines in the script the location of the folders 'CAM1' and 'CAM2' and the number of images in these folders ('imnum')
for i:imnum
x{i}=imread(strcat(link,'CAM1\',num2str(i),'.tif'));
y{i}=imread(strcat(link,'CAM2\',num2str(i),'.tif'));
I would like to have your view on this problem and hopefully you can make some suggestions on how I can import the images in a folder in one go and keep the data type uint16. I'm always open for suggestions so if you have other ideas on how to solve my problem, I would love it if you shared them with me. If anything is unclear, please contact me with questions!
With kind regards,
Reinier
x is a cell array, where each element x{i} is a uint16 array. Cell arrays can hold any other datatype, including more cell arrays, and are a great way to wrap collections of objects, especially when their sizes and/or types may differ.
In your case, just call your function like this:
T = alim(x{i}, y{i}, tstart);
Or, even better, put the output matrix into a similar cell:
T{i} = alim(x{i}, y{i}, tstart);