How can I view only a subregion of my data in the Volume Viewer app?
2 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2025 年 3 月 13 日
回答済み: MathWorks Support Team
2025 年 6 月 20 日
I want to limit the region of my data I am visualizing in the Volume Viewer app. How can I set the x-, y-, and z-axis limits for the volume?
採用された回答
MathWorks Support Team
2025 年 3 月 13 日
この 回答 は Walter Roberson
さんによってフラグが設定されました
The viewport in volshow is fundamentally different than the dataspace viewport that the MATLAB axes uses, so there is no direct equivalent to clipping the dataspace by setting XLim, YLim, and ZLim. The closest functional equivalent to this workflow where you want to view only a subregion of your data would be to use the "CropRegion" property on the viewer.
If you want to view a subregion of your data, similar to "xlim" and "ylim" workflow for figures, you can use the "CropRegion" property of the Volume Viewer. For example:
% Display volume in volshow
>> V = rand([100,100,100]);
>> obj = volshow(V);
>> viewer = obj.Parent;
% Specify the CropRegion to only view a subregion of the data. Region should be specified as a 2x3 where the first row is the x,y,z min value, and the second row is the x,y,z max value
>> viewer.CropRegion = [0.5, 0.5, 50.5; 100.5, 100.5, 100.5];
By default, this crop region is interactive, but you can disable interactivity with the "viewer.Interactions" property:
If, instead, you want to scale and translate your volume data to fit a desired region in world coordinates, consider the following option:
Let's say you have a 100x100x100 volumetric data that you wanted to span some dimensions in world coordinates, you can use an "imref3d" object to specify the spatial referencing for the volume. For example:
% Create a imref3d object for the volume V and specify the z limits should be from 0.5 to 200.5:>> ref = imref3d(size(V));>> ref.ZWorldLimits = [0.5, 200.5]% Create volshow window with this imref3d object applied:>> obj = volshow(V,"Transformation",ref);
Additionally, you can specify a 3-d transformation object like "affinetform3d" (and related objects like "rigidtform3d") to have additional control over the volume positioning in world coordinates.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で 3-D Volumetric Image Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!