这是用户在 2024-7-20 15:19 为 file:///C:/Users/SuBoNing/Desktop/%E6%89%8B%E5%86%8C.HTML 保存的双语快照页面,由 沉浸式翻译 提供双语支持。了解如何保存?

 DVC 配置步骤



每个面板都包含 DVC 配置过程中的不同步骤。在每个面板之间移动时,帮助部分会更新。将鼠标悬停在界面上的某些按钮和标签上可以查看其他帮助。

 初始注册


DVC 分析的第一步是排列参考图像并关联图像。图像之间的刚体平移将被输入到DVC分析代码中。转到“初始注册”选项卡即可开始使用。


0点位置

First, the button **Select point 0** needs to be clicked. Then, point 0 is selected by pressing "shift" and left clicking on a point in the image. 
Next, the size of the registration box can be edited.
The slice where point 0 lies can always be visualised by clicking on the button **Center on Point 0**. In particular, this becomes useful after other slices of the 3D image have been visualised.
Point 0 will be used as the global starting point in the DVC analysis, as well as the reference point for the translation. Point 0 is used in the "Point Cloud" tab, where a point cloud is loaded or generated from the mask selected in the "Mask" tab. If point 0 does not lie within the mask, it will be added as the first point in the cloud.
Registering the Images


选择点 0 和配准框尺寸后,通过单击“开始配准”来初始化配准过程。这将运行自动注册过程,结果显示在“平移 X”、“平移 Y”和“平移 Z”小部件以及“自动注册”标签小部件中。观察器显示代表参考体积和相关体积之间差异的图像。这显示在一个边长等于所选“注册框大小”的正方形中。图像可以在 3D 中跨越,并且最初以切片嵌入点 0 为中心。可以通过单击“中心在点 0”按钮来检索此视图。差异图像是根据全分辨率体积计算的,而不是根据它们的下图计算的。采样版本。如果两个体积相同,则它们的体积差异将导致像素值为 0,并且查看器将显示黑色方块。当两个图像的差异体积尽可能均匀时,它们的配准效果最佳,并且在查看器中以大量灰色像素显示。可以通过单击差异图像并使用“j”、“n”、“b”和“m”键相对于彼此移动两个体积来手动调整配准过程。使用“x”、“y”和“z”键可以更改图像方向,并滚动图像切片。


下面显示了最佳配准的示例,其中差异图像大部分是灰色的。


.. 图像:: images/registration_example_0.png :宽度: 49%


.. 图像:: images/registration_example_1.png :宽度: 49%


.. 作用:: raw-html(raw) :format: html

:raw-html:<br />


单击重置按钮将翻译设置为 [0, 0, 0]。单击“设置为自动注册”按钮可将翻译重置为自动注册的值。对注册感到满意后,单击“确认注册”按钮,并在下一个选项卡中存储 DVC 分析的翻译值。单击“取消”按钮终止注册过程并检索之前的翻译值。单击“重新启动注册”按钮再次重新启动注册过程。


仅当注册已至少确认一次时才移至“掩码”选项卡。

 面具创作


点云将在用户定义的掩模内创建。掩模是一个二值图像,其中代表点所在的位置。 iDVC 允许您通过文件创建或导入蒙版。对蒙版感到满意后,请转到点云面板。

 创建蒙版

A mask is created by tracing the cross section of the mask and extending it above and below the current slice by **Slices Above** and **Slices Below** values. 
More complex masks can be created by extending the mask by multiple tracing.
The user can trace in 2 modalities: free hand and or by inserting multiple segments separated by point handles.
Click on the **Start Tracing** button to draw a mask and enable tracing on the viewer.
Freehand tracing:
- Draw a free hand line: left button click over the image, hold and drag.
- Erase the line: left button click and release.
Multisegment tracing:
- Start a snap drawn line: middle button click. Terminate the line by clicking the middle button while depressing the ctrl key.
- Form a closed loop with the line: trace a continuous or snap drawn line and place the last cursor position close to the first handle.
- Point handle dragging: right button click and hold on any handle that is part of a snap drawn line. The path can be closed by overlappingg the first and last points.
- Erase any point handle: ctrl key + right button down on the handle.
- Split a segment at the cursor position: shift key + right button down on any snap drawn line segment.
The 2D mask drawn in the viewer is used across multiple slices in 3D, above and below the current slice; the volume can be adjusted by editing the **Slices Above** and **Slices Below** values. Click on **Create mask** when the tracing is finalised.
Note: the **Slices Above** and **Slices Below** are in the coordinate system of the downsampled image (if the images have been downsampled).
Extending a mask


如果遮罩需要覆盖多个区域,或者需要放大遮罩的区域,请勾选“扩展遮罩”复选框。然后,绘制另一个区域并按“扩展蒙版”按钮。


如果未选中“扩展蒙版”,则跟踪时蒙版将被重置。

 节省面具

The most recent mask that has been created will automatically be applied. 
If it is intended to draw more than one mask click on the **Save Mask** button. Else, the older mask will be discarded if a new mask is created without saving the previous one.
The names of all of the saved masks will appear in a dropdown list. Each mask can be selected and reloaded by clicking on **Load Saved Mask**.
Note: the mask is created in the coordinate system of the down-sampled image. If the down-sampling level is changed, you may not be able to reload a mask you have previously generated.
Loading a mask from file


作为创建掩码的替代方法,可以通过单击从文件加载掩码来从文件加载掩码。文件格式应该是未压缩的元图像文件,扩展名为“.mha”。

 点云


创建点云

First of all, set a **size** for the subvolumes in the point cloud.
This is the diameter of a spherical subvolume region, or the side length of a cubic one.
.. image:: images/pointcloud_panel.png
:raw-html:`<br />`
If you have ticked the option to **display the subvolume preview**, then a preview of the size of each subvolume will be shown in the viewer, centred on the location of the reference point 0.
If you select a **2D** point cloud, then the point cloud will only be created on the currently displayed slice of the image. A **3D** point cloud will be created across the entire extent of the mask.
The **Overlap** is the percentage overlap of the subvolume regions. You can also set a **Rotation Angle** of the subvolumes in degrees, relative to any of the three axes.
Parts of some of the subvolumes may lie outside of the mask, although all of the points will lie within the mask. You may choose to erode the mask by ticking **Erode mask**. Eroding the mask will help ensure the entirety of all of the subvolume regions lies within the mask. Be aware that this is quite a time consuming process. You may also adjust the **Erosion multiplier**, which will change how heavily this erosion process takes place – you may decrease the multiplier if it does not matter if some subvolumes are partially outside of the mask.
The **Display Subvolume Regions** option allows to turn on/off viewing the subvolumes, but the points themselves will still be displayed. The **Display Registration Region** toggles on/off the view of the registration box centred on point 0.
.. image:: images/3D_pointcloud.png
:raw-html:`<br />`
Saving and Loading a point cloud


您最近创建的点云将自动保存,但如果您想创建新的点云,系统会提示您保存之前的点云,否则它将被丢弃。您保存到当前会话的所有点云的名称将显示在下拉列表中。您可以从此处选择一个并重新加载。


或者,您可以从保存的文件加载点云。允许的文件格式为 txtcsvxlxsinp 。这可以是一个制表符分隔的文本文件,第一列中包含点编号,后跟每个点的 x、y 和 z 坐标。


一个例子如下所示。文件中的第一个点将用作 DVC 分析的起点。请注意,您可以使用非整数坐标。


.. 图像:: images/pointcloud_txt_example.png

:raw-html:<br />


请注意,点云位于原始图像的坐标系中,并且不受下采样的影响,它显示在点的真实位置。一旦您对点云感到满意,您就可以转到“运行 DVC”面板。


要删除点云,您应该按清除点云按钮。


.._运行DVC分析:


运行 DVC 分析


首先,为您的跑步设置一个名称。这就是保存运行的方式,稍后当您想要查看结果时需要引用该名称。您可以为跑步更改的设置如下:


.. 图像:: images/run_dvc_panel.png

:raw-html:<br />


运行云中的所有点 - 单击此按钮会将运行中的点重置为点云中的所有点。运行中的点数 - 您想要执行运行的点数。这将自动开始设置为您创建的云中的点总数,但您可能希望一开始就使用较少的点来运行,例如作为测试。如果您选择的点少于云中的总数,并且参考点 0 位于点云内,则将从点 0 开始并从那里向外选择点。


最大位移 - 定义参考图像体积内预期的最大位移。这是一个非常重要的参数,用于搜索过程控制和内存分配。设置为刚好大于实际样品最大位移的合理值。请小心:大位移会使搜索过程变慢且可靠性降低。最好通过图像体积操作来减少大的刚体位移。未来的代码开发将引入更好地管理大位移的方法。 Suitable values: 1 -> smallest dimension of the image volumes


自由度数 - 定义搜索最后阶段的自由度集。实际的搜索过程会分阶段引入高达该值的自由度。翻译仅足以进行快速、初步的调查。在大多数情况下,添加旋转将显着提高位移精度。为需要最高精度的情况保留应变自由度。


目标函数——定义目标函数模板匹配形式。请参阅 B. Pan,模式匹配的数字图像相关标准的等效性,2010 年。随着从悲伤发展到 znssd,功能变得越来越昂贵且更加强大。最小化平方差和最大化互相关在功能上是等效的。


关于目标函数值的注释:


插值类型 - 定义模板匹配期间使用的插值方法。选项:最近、三线性、三三次。


子体积中的采样点 - 定义每个子体积内的点数(最大值为 50000)。在此代码中,子体积点位置不是以体素为中心,并且数量与子体积大小无关。参考图像体积内的插值用于建立具有任意点位置的模板。


该参数对计算时间有很大影响,所以要小心。然后,您可以运行单次运行或批量运行:


对于每次运行,生成的 DVC 分析代码的任何点云和输入文件都保存在会话文件中,如果导出会话,您就可以访问这些文件(请参阅:ref: Exporting Sessions <Exporting Sessions> )。

 运行进度

Whilst the DVC analysis is running, you will see updates on its progress, as below:
.. image:: images/run_progress_bar.png
The 1/1 on the first line indicates that it is on run 1 out of a total of 1 run, and then on the next line it shows it is on point 20 out of a total of 4630 for this run. Following this we have:
- **[x,y,z] location** of the point.
- The search status:
**Point_Good** = successful search convergence within the max displacement.
**Range_Fail** = max displacement exceeded; consider increasing the disp_max parameter.
**Convg_Fail** = maximum iterations exceeded; consider increasing subvol_size &/or npts. - The **magnitude of the objective function value** at the end of the search is listed as obj=
For ``obj_function = sad, ssd, and zssd`` the value is relative, depending on subvolume size and pixel values. For ``obj_function = nssd and znssd`` the value is scaled between 0 and 2, with zero a perfect match. - The point **[x,y,z] displacement** is listed next for successful searches.