Removing part of a dimension
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mathijs Dijsselhof
am 26 Nov. 2019
Kommentiert: Mathijs Dijsselhof
am 26 Nov. 2019
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!
0 Kommentare
Akzeptierte Antwort
Turlough Hughes
am 26 Nov. 2019
Bearbeitet: Turlough Hughes
am 26 Nov. 2019
Hi Mathijs,
If your data is called MRI, then the following should do the job:
MRI(:,:,:,logical(OutlierArray))=[];
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu MRI finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!