Does anyone know why the images appear that way?

5 visualizaciones (últimos 30 días)
Stelios Fanourakis
Stelios Fanourakis el 6 de Jul. de 2018
Comentada: Stelios Fanourakis el 15 de Jul. de 2018
The shifted slight translation you'll see in the three plots is correct but why do they appear black and white (duotone)?
They should appear normal grayscale DICOM images. Any idea why this is happening?
I use imtranslate, griddedInterpolant and GridVectors for the translation
  14 comentarios
Jan
Jan el 12 de Jul. de 2018
Editada: Jan el 12 de Jul. de 2018
@Stelios: Do you see the problem? You have posted "use imshow and the uint8() command" and only by bold guessing, what this could mean, a substantial problem has been found. Please, Stelios, care for posting the required details, most of all the relevant part of the code.
"I still get a wrong outcome" does not allow to help you. We cannot read your mind or guess, which detail is wrong or what you consider to be right.
The new screenshots look much more like something I'd expect. So I think your former code to convert between double and uint8 contained a bug. Maybe there is another bug also.
Stelios Fanourakis
Stelios Fanourakis el 12 de Jul. de 2018
@Jan. I have sent all my resources (m files, fig, images) previously so you can assess them. If you have not received them, please let me know, to re send them. It is obvious what the problem is. I want normal grayscale DICOM images, NOT black and white lines. I want to "open" somehow the stack and translate every slice individually based on the 2nd column of the txt file I have sent. It is that simple. Do you need all the resources again so you can give me a valuable answer?

Iniciar sesión para comentar.

Respuestas (4)

Matt J
Matt J el 6 de Jul. de 2018
Editada: Matt J el 6 de Jul. de 2018
Maybe try this (see also Anton's comment),
im(~isfinite(im))=0;
Then reload the resulting im to the viewer.

Image Analyst
Image Analyst el 7 de Jul. de 2018
No, you didn't try Anton's suggestion because you said "I already use imshow and the uint8() command to bring it back from double. " Well sorry but that won't correct the problem. You have a double image, and imshow() without any [] expects that the range of the image will be between 0 and 1. Anything less than 0 will show up as black and anything more than 1 will show up as white. Your data is fine and good, it's just not being displayed properly. Why don't you at least try to show it with []. Please just humor us and try it:
maxValue = max(im(:)) % Don't use a semicolon
maxValue = min(im(:)) % Don't use a semicolon
imshow(im, []);
What does it show in the command window for the max and min? And do the images now look good? If not, save the image to a .mat file and attach it with the paper clip icon.
  13 comentarios
Matt J
Matt J el 7 de Jul. de 2018
I don't really see why the histogram would change simply by converting to double...
Stelios Fanourakis
Stelios Fanourakis el 15 de Jul. de 2018
@Matt. I though of another solution. When I use result = F(g) I apply interpolation again to g which are the original set points (image) multiplied by translation_vector.
That means that the original image has already been shifted plus a new interpolation coming on the way (F(g)). Does it make it somehow to be smushed or squeezed?
If I visualize with only g without F(g) I get errors later on to the uicontrol of the slider (e.g. Index Exceeds Matrix Dimensions).
Would it be correct to visualize only with g?

Iniciar sesión para comentar.


Stelios Fanourakis
Stelios Fanourakis el 7 de Jul. de 2018
Editada: Image Analyst el 7 de Jul. de 2018
But it does. Before I apply the double() it is a normal grayscale pic. After double(), it becomes white with shapes.
And the result is just a plain white image.
  12 comentarios
Stelios Fanourakis
Stelios Fanourakis el 11 de Jul. de 2018
Gosh! I wouldn't expect to be that difficult. I know it's just a problem with the image display but nobody seems to find that.
Stelios Fanourakis
Stelios Fanourakis el 15 de Jul. de 2018
I have another assumption. im2 is a 4D interpolated stack of images (stack out of 15 images) using interp3.
Interpolation to me, means that it creates in between images. For example, if there is 1 to 2 image, the interpolation will give us 1.5 image. Am I correct? So that's what interp3 does. It increases the number of images above 15, where they really are.
Then, by importing im2 to GriddedInterpolant, again another interpolation takes place, so even more subimages are created. Thus, the total number of slices that consist the stack may exceed 30, but, definitely it won't be 15 where it started.
Then, with GridVectors I turn it to cell array and by multiplying with the translation_vector, supposedly they are shifted. BUT, the translation_vector matrix is consisted out of 15 rows and 2 columns. 15 rows as the original images NOT the interpolated ones. So, a lot of images do not shift.
Am I right to my assumption. Is this more clear so we can find a solution?

Iniciar sesión para comentar.


Stelios Fanourakis
Stelios Fanourakis el 11 de Jul. de 2018
I wonder, do I have to pay to get a solution?
  1 comentario
Stelios Fanourakis
Stelios Fanourakis el 15 de Jul. de 2018
I have another assumption. im2 is a 4D interpolated stack of images (stack out of 15 images) using interp3.
Interpolation to me, means that it creates in between images. For example, if there is 1 to 2 image, the interpolation will give us 1.5 image. Am I correct? So that's what interp3 does. It increases the number of images above 15, where they really are.
Then, by importing im2 to GriddedInterpolant, again another interpolation takes place, so even more subimages are created. Thus, the total number of slices that consist the stack may exceed 30, but, definitely it won't be 15 where it started.
Then, with GridVectors I turn it to cell array and by multiplying with the translation_vector, supposedly they are shifted. BUT, the translation_vector matrix is consisted out of 15 rows and 2 columns. 15 rows as the original images NOT the interpolated ones. So, a lot of images do not shift.
Am I right to my assumption. Is this more clear so we can find a solution?

Iniciar sesión para comentar.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by