필터 지우기
필터 지우기

Removing part of a dimension

조회 수: 2 (최근 30일)
Mathijs Dijsselhof
Mathijs Dijsselhof 2019년 11월 26일
댓글: Mathijs Dijsselhof 2019년 11월 26일
Hi all,
I have a 4D MRI dataset of 80 x 80 x 16 x 23 from which I calculate movement outliers based upon standard deviation. I receive as output an logical array of 1x23 showing outliers with a value of 0. Example: OutlierArray = [1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]
I want to remove the outlier located at, in this case, the 5th volume using the 'OutlierArray' variable and concatenate the remaining volumes.
The resulting 4D dataset would then look like 80 x 80 x 16 x 22.
Can someone please help me? Thanks in advance!

채택된 답변

Turlough Hughes
Turlough Hughes 2019년 11월 26일
편집: Turlough Hughes 2019년 11월 26일
Hi Mathijs,
If your data is called MRI, then the following should do the job:
MRI(:,:,:,logical(OutlierArray))=[];
  댓글 수: 1
Mathijs Dijsselhof
Mathijs Dijsselhof 2019년 11월 26일
Thanks this works!
I also found my own solution:
A(:,:,:,OutlierArray>0)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MRI에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by