How to remove overlapping between labels in ITK snap? - vtk

I have 3 labels in for a 3D image. But one of the labels is also present (slightly) between the other two labels. Please refer the rough image below where I don't want the blue label to be present in between red and green labels ..rather I want to replace it with green label. I have been trying it solve this problem with ITK Snap and Convert3D software.
click here to view the image

If you don't mind using an other software, you could load the image in 3D Slicer (https://download.slicer.org/) and use the Segment editor to "identify the island" and then update the value of the segment associated with the thin blue one. See https://slicer.readthedocs.io/en/latest/user_guide/module_segmenteditor.html

Related

Create an image or photo that can change colour in Tkinter

I need to display an outline of a dog in a window. I then need to be able to change the colour for different part of the dog by inputting numbers into entry boxes- for example if I put a '1' in the 'head' entry box, the head changes to a yellow colour. The dog should be white by default.
I can just create 4 images (one for the head, body, legs, and tale) to change each part of the bod. I've thought about changing the rgb values of each image to change the colour, but this would also change the colour for the outline (meant to stay black). The only other thing I could think of was making a red, blue, green, yellow, blue, etc. version of each image (head, body, legs, tail), and then just displaying the red version of the image when I need to (and the same for other colours).
I need to know if there is any other way to do this (perhaps with the canvas widget?) before I code it because It will take a long time to change the colour of each image. I just have no idea where to start.
Thanks in advance for your answers
You will have to make different widgets for each part of the dog(e.g: Head, Abdomen etc.) and you will need different images for the dogs part and color, after that you can implement a button that changes the color with the 'if' function.

Colour isolation

I'm fairly new to GIMP
I have some black-and-white images in RGB mode. I want to highlight some areas in plain Red (ie, zero Blue+Green), some in plain Blue (ie, zero Red+Green), and the rest in plain Green (ie, zero Red+Blue)
I will be selecting several areas using Paths, though a simple rectangle would be fine for now
The final image will be Green, with 2+ selections of Red, and 2+ selections of Blue
I have experimented with multiple layers & multiple images, but I always get problems with the selection areas
Thanks in advance !
If what you want is keep the value of the R (or G or B) channel in the selection, while setting the other two components to 0:
Create a layer group above your image layer
Add a transparent layer in the group, name it "Green", bucket-fill with green
Add a transparent layer in the group, above "Green", name it "Red+Blue"
Set the group to "Multiply" mode. You should see your image in green.
To add red/blue, make a selection, make sure "Red+Blue" is the active layer, and bucket fill the selection with Red or Blue.
Notes
With some selection tools, (path, ellipse...) you may have to use Select>Sharpen before the bucket-fill to make sure that there are no partially selected pixels
To see the original image when making selections, just make the group invisible.
You can also use two separate layers for Red and Blue (both above the Green one, in the layer group)
If what you want is just areas of #FF0000 and #0000FF over a #00FF00 background, then just hide the initial image layer when exporting.

Is there a way to transform rectangle into any shapes in MS Excel?

In MS Excel, I applied conditional formatting to a cell A1 so that it's color changes from blue at value 0 and red at value 100. I copied that cell and pasted it as linked picture(I) specially.(Paste Special). The color of the rectangle picture now changes if value in original cell is changed. The problem is, the shape is only rectangular, it can be converted into square and diamond shape at best.If same rectangle can be transformed into different shapes(maybe by adding extra anchor on rectangle shape), a heat map can be created easily. Please share your insights about this thing if there is a way.
Following pictures may help understand the problem:
[Example][1]
If you want a heat map, please consider using a CHART not gazillions of picture objects, colored/placed/rotated/etc to ... mimic a chart.
First, google anything about "surface chart" in Excel, see how it looks in Excel, whatever. Just see it and think about it so you can compare it to your current approach.
You will observe some things, like:
it's 3D
it has just a few layers/colors
etc.
But really, all of them can be solved. Probably easier than your current approach.
you can easily turn off both axes and you can rotate it so the camera is totally straight top-down - then it looks flat as paper and noone can see it as 3D anymore
you can add more layers, you can set each of them to specific colors
etc.
Some resources:
multiple colors in surface chart
how to change rotation of 3d chart
geesh, I just found even a whole article/tutorial dedicated to creating heat map charts.
Please, read that last link and I'm pretty sure you will want to use that approach instead of doing picture puzzles.

Change pixels color [duplicate]

I have more then 1 week reading about selective color change of an image. It meand selcting a color from a color picker and then select a part of image in which I want to change the color and apply the changing of color form original color to color of color picker.
E.g. if I select a blue color in color picker and I also select a red part in the image I should be able to change red color to blue color in all the image.
Another example. If I have an image with red apples and oranges and if I select an apple on the image and a blue color in the color picket, then all apples should be changing the color from red to blue.
I have some ideas but of course I need something more concrete on how to do this
Thank you for reading
As a starting point, consider clustering the colors of your image. If you don't know how many clusters you want, then you will need methods to determine whether to merge or not two given clusters. For the moment, let us suppose that we know that number. For example, given the following image at left, I mapped its colors to 3 clusters, which have the mean colors as shown in the middle, and representing each cluster by its mean color gives the figure at right.
With the output at right, now what you need is a method to replace colors. Suppose the user clicks (a single point) somewhere in your image, then you know the positions in the original image that you will need to modify. For the next image, the user (me) clicked on a point that is contained by the "orange" cluster. Then he clicked on some blue hue. From that, you make a mask representing the points in the "orange" cluster and play with that. I considered a simple gaussian filter followed by a flat dilation 3x5. Then you replace the hues in the original image according to the produced mask (after the low pass filtering, the values on it are also considered as a alpha value for compositing the images).
Not perfect at all, but you could have a better clustering than me and also a much-less-primitive color replacement method. I intentionally skipped the details about clustering method, color space, and others, because I used only basic k-means on RGB without any pre-processing of the input. So you can consider the results above as a baseline for anything else you can do.
Given the image, a selected color, and a target new color - you can't do much that isn't ugly. You also need a range, some amount of variation in color, so you can say one pixel's color is "close enough" while another is clearly "different".
First step of processing: You create a mask image, which is grayscale and varying from 0.0 to 1.0 (or from zero to some maximum value we'll treat as 1.0), and the same size as the input image. For each input pixel, test if its color is sufficiently near the selected color. If it's "the same" or "close enough" put 1.0 in the mask. If it's different, put 0.0. If is sorta borderline, put an in-between value. Exactly how to do this depends on the details of the image.
This might work best in LAB space, and testing for sameness according to the angle of the A,B coordinates relative to their origin.
Once you have the mask, put it aside. Now color-transform the whole image. This might be best done in HSV space. Don't touch the V channel. Add a constant to S, modulo 360deg (or mod 256, if S is stored as bytes) and multiply S by a constant chosen so that the coordinates in HSV corresponding to the selected color is moved to the HSV coordinates for the target color. Convert the transformed S and H, with the unchanged L, back to RGB.
Finally, use the mask to blend the original image with the color-transformed one. Apply this to each channel - red, green, blue:
output = (1-mask)*original + mask*transformed
If you're doing it all in byte arrays, 0 is 0.0 and 255 is 1.0, and be careful of overflow and signed/unsigned problems.

Box plot with labels and axes, fitted to a div with fixed dimensions

Following the provided example I built a function that draws a box plot to a jQuery accordion tab, which has a certain fixed height & width. The amount of distinct categories varies greatly depending on the incoming data. Currently I'd like to achieve the following in the plotting:
1) Add axes and display labels, like in this picture
2) Always fit the boxes to container width and height. Currently I see that if there are too many categories, some of them end on the second row, ensuring they're not fully seen. In the picture, the div contains 7 boxes but only 4 fit on one row:
The question is how can these two be implemented? I couldn't even figure out a way to reliably reduce the padding between the boxes without eating into the side numbers on the boxes.
I adopted the original d3.js example to include axes:
http://bl.ocks.org/jensgrubert/7789216
Instead of using individual svg elements as in Mike's implementation, here all boxplots are rendered with in one root element. This makes it easy to add axes.
Best,
Jens
For the time being I'm using a hack found at Highcharts forum (jsfiddle here). There's also a box plot implementation made with Raphael.js that looks cool (github, example)

Resources