Derivative of 2D dose (intensity) image wrt distance
1 次查看(过去 30 天)
显示 更早的评论
I have a 2D image of size M×N representing a radiation dose map with a local dose
, where
is the spatial coordinate. I want to estimate both derivatives
and
with respect to r - how do I do that? If neccessary, the spatial resolution is 21
/pixel and isotropic.





Thanks in advance for any help or guidance!
0 个评论
回答(1 个)
Aastha
2025-6-11
I understand that you have a 2D image representing a radiation dose map and you want to compute the first and second-order spatial derivatives. You have also mentioned that the spatial resolution is 21 μm/pixel.
To compute the derivatives, you may refer to the steps outlined below:
1. Use the “gradient” function to compute the first-order spatial derivatives using a finite difference approximation. Kindly refer to the MATLAB code snippet below to do so:
delta = 21e-6; % Spatial resolution in meters (21 micrometers)
[dose_dy, dose_dx] = gradient(dose, delta); % Compute gradient components
At each pixel, this returns two values corresponding to the partial derivatives ∂dose/∂y and ∂dose/∂x.
You may refer to MathWorks documentation of “gradient” function for any queries on it:
2. To compute the second-order spatial derivatives, apply the gradient function again to the first-order derivatives. This yields the entries of the Hessian matrix at each pixel:
[d2Iyy, d2Iyx] = gradient(dose_dy, delta); % ∂²dose/∂y² and ∂²dose/∂y∂x
[d2Ixy, d2Ixx] = gradient(dose_dx, delta); % ∂²dose/∂x∂y and ∂²dose/∂x²
These second-order derivatives describe how the gradient itself changes spatially and can be assembled into the Hessian matrix to analyze curvature and local structure.
I hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!