Data manipulation question
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello All,
I have got a slightly tricky matlab question that I would like to seek help from everyone out there.
I have got a logic with the size of 143x143x143. It was derived from a cubic bone sample with the size of 143x143x143 voxels (data points). It contains both "0s" and "1"s. "0s" represents marrow voxels and "1s" represents bone voxels.
What I am hoping to do is to conduct so called "resolution analysis". I will explain in detail.
Basically, the original size of the cubic model was 143x143x143 voxels. What I need to do now is to treat the cubic bone model as 71x71x71 (71 as 143/2, it is called "resolution 2x2" analysis), an then, I will need to do 35x35x35 (resolution 4x4 analysis) until 1x1x1 (resolution 128x128 analysis).
Let's use the resolution "2x2" analysis as an example. I know by now in any given location, whether the voxel in this location is bone or marrow. The next task is to workout in a "2x2" sqaure box (let's called it super-voxel), what is the "transit time" of this super-voxel is going to be using the following formula.
If in this 2x2 square box, I have got "1100" combination. The transit time is then going to be 0.5.
If the combination is "1111", the transit time is going to be 1
If the combination is "0000", the transit time is going to be 0
If the combination is "1110", the transit time is going to be 0.75 (the order of 1s and 0s do not matter)
If the combination is "0001", the transit time is going to be 0.25 (the order of 1s and 0s do not matter)
What I am hoping to do is to write a loop in Matlab that can do the following,
It starts to check "row 1, column 1; row 1, column 2; row 2, column 1; row 2, column 2" and treat this four voxels (data points) as a the "super-voxel" and workout the "transit time" value according to the formula mentioned previously. The transit time value will then be stored into a new matrix with the size of 71x71x71. Then it will move on to check "row 1, column 3; row 1, column 4; row 2, column3; row 2, column 4" and stored the transit time value into the 71x71x71 matrix. It will keep going until all voxels have been checked.
Any suggestions on how to solve this problem is greatly appreciated.
Thanks a lot in advance.
John
0 Kommentare
Antworten (1)
Jan
am 23 Mär. 2011
I do not understand how the 3rd dimension is processed. Converting "0001" to 0.25 seems to be a simple MEAN. Does FEX: BlockMean help?
0 Kommentare
Siehe auch
Kategorien
Mehr zu Convert Image Type 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!