이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
Image with Horizontal Longitudinal View
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi. I'm new in image processing. I have a multi frame image which consist of 271 frames . and i want to cut each slice to get longitudinal view as shown in attached figure. I have the upper portion of image . and want to get lower view . any one please help me
댓글 수: 4
Guillaume
2018년 4월 26일
How is the multiframe image stored in matlab? A 4D array (height x width x RGB x frame)?
Arsalan Akbar
2018년 4월 26일
편집: Arsalan Akbar
2018년 4월 26일
i have discussed this with some friends . they said that make 3D dataset (x, y, z). Here z is no of frames.
Cross-sectional image consists of (x, y) data set with z is from 1 to 271 (assuming we have 271 frames)
Longitudinal cut image consists of (y, z) data set with x is from 1 to 360 degrees.
Walter Roberson
2018년 4월 26일
Please recheck the bounds and sizes. 0 to 271 is 272 different values. 0 to 360 is 361 different values.
When the slicing is done, is the location to be specified as an index, or is it to be specified by value that might not happen to correspond exactly to an index? If it is by value that might be between the locations of two stored locations, then should the nearest location be taken or should linear interpolation be used to blend the adjacent locations?
채택된 답변
Guillaume
2018년 4월 26일
If I understood correctly. The multiframe image is greyscale or indexed, since each image is 2D, and the frame are the pages of a 3D matrix. From that you want a slice of each frame, a single column of each image, concatenated together horizontally as a single image. If so:
sliceimage = permute(yourmultiframeimage(:, slicecolumn, :), [1 3 2]);
댓글 수: 18
Arsalan Akbar
2018년 4월 26일
1st 100 frame are not showing properly . i an sending you 1st 10 images can you please apply on this .
Walter Roberson
2018년 4월 26일
%going in reverse order effectively takes care of pre-allocation
for K = 271:-1:1;
yourmultiframeimage(:,:,:,K) = imread(sprintf('%d.tif',K));
end
slicecolumn = 173;
sliceimage = permute(yourmultiframeimage(:, slicecolumn, :), [1 3 2]);
image(sliceimage);
colormap(gray(256));
Looks okay to me on the 10-image subset you provided.
Arsalan Akbar
2018년 4월 27일
how i can cut the image longitudinal by changing its x-axis from 0 to 180 degree to get different view of circular shape?
Walter Roberson
2018년 4월 27일
slicerow = 57;
sliceimage_x = permute(yourmultiframeimage(slicerow, :, :), [2 3 1]);
image(sliceimage_x);
colormap(gray(256));
Arsalan Akbar
2018년 4월 28일
This is what i'm looking for...
cutting the image with different angles but always from center of image
Walter Roberson
2018년 4월 28일
Use interp3() with y = m*(x-xc)+yc and m = tand(angle) (but watch out for vertical) . You might want to have a look at the improfile() source code to see how it calculates which intermediate points to sample at.
Guillaume
2018년 4월 28일
I assume you're capable of calculating the coordinates of the end points of the line segment going through the image at whichever angle you want. E.g, for 45° (for a square image),
x = [1, size(yourmultiframeimage, 2)];
y = [1, size(yourmultiframeimage, 1)];
Then the simplest thing is to ask improfile for the coordinates of the pixels in between, then use that to extract the pixels of each frame:
[linex, liney, ~] = improfile(yourmultiframeimage(:, :, 1), x, y);
sliceimage = yourmultiframeimage(sub2ind(size(yourmultiframeimage), ...
repmat(round(liney), 1, size(yourmultiframeimage, 3)), ...
repmat(round(linex), 1, size(yourmultiframeimage, 3)), ...
repmat(1:size(yourmultiframeimage, 3), numel(linex), 1)));
Guillaume
2018년 4월 30일
Who are you replying to and what does I'm not able to get your point actually mean?
Arsalan Akbar
2018년 4월 30일
Sorry Brother
I'm not able to calculate the endpoints of a line segments at certain angle . can you please help me
Guillaume
2018년 5월 1일
I'm not able to calculate the endpoints of a line segments at certain angle
Seriously? It's elementary math. Do put in some effort
%angle: angle in degree, clockwise from vertical
xcentre = floor(size(yourimage, 2) / 2);
ycentre = floor(size(yourimage, 1) / 2);
xtop = xcentre + ycentre / tan(angle);
yright = ycentre - (size(yourimage, 2) - xcentre) * tan(angle);
xbottom = xcentre - (size(yourimage, 1) - ycentre) / tan(angle);
yleft = ycentre + xcentre * tan(angle);
if xtop < 0 | xtop > size(yourimage, 2)
x = [1, size(yourimage, 2)];
y = [yright, yleft];
else
x = [xbottom, xtop];
y = [size(yourimage, 1), 1];
end
Arsalan Akbar
2018년 5월 3일
Brother when i cut the image with some angle it not give me the correct result. i have attached the images can you please check this . the 1st one is the result which i want but i 'm getting the second one . can you please have i look where i am doing error.
i have attached the code also
please your help needed
Guillaume
2018년 5월 3일
In the very first line of my answer, I wrote: "If I understood correctly, the multiframe image is greyscale or indexed". (i.e. each frame is 2D and the multiframe image is 3D). All my answers were written with that assumption.
From your code, it looks like each frame is RGB (3D), which means the answer you accepted wouldn't have worked unless you converted the frame to greyscale. If so, do the same for the other angles.
Arsalan Akbar
2018년 5월 3일
its a gray scale image and i have change the code to 3d but again the output is wrong . here i have attached the output image
Arsalan Akbar
2018년 5월 3일
I have a gray scale image .which consist of 271 frames . i created a 3D array and store all the frame in that array . after it i take one frame cut it with some angle and get its longitudinal view . store it and goes to next frame. i dont know this approach is good or not
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)