Closed cclaess closed 2 years ago
Hi, @CrisClaessens. I agree the documentation is not great. Contributions are welcome!
I'm not sure what imread
is.
sigmas
should be a sequence of three floats >= 0:
They represent the standard deviation across each dimension of the Gaussian kernels used to smooth the masks for the alpha blending, to simulate partial-volume effects, in mm.
More information in the ITK docs for SmoothingRecursiveGaussianImageFilter
.
radii
should be a sequence of three floats > 0. They are the three semi-axes of the ellipsoid used to model the cavity, in mm.
@fepegar Thanks a lot! So if I understand correctly, you would want to choose different values for these every time you are generating a different resection in the same image? In the case I am correct, what are the ranges of these vectors that are used when I just use resect t1.nii.gz gif_parcellation.nii.gz t1_resected.nii.gz t1_resection_label.nii.gz
in the command prompt?
resect
uses the RandomResection
transform:
whose default values for its kwargs can be found in the code:
In this hard-coded implementation, the sigmas will be sampled from a uniform distribution U(0.5, 1), but the radii are computed from the volume and the radii ratios, which are also sampled. All the information is in the open-access paper:
πS(ππ) is a scaling transform, where (π1,π2,π3)=ππ are semiaxes of an ellipsoid with volume v used to model the cavity shape. The semiaxes are computed as π1=π, π2=ππ and π3=π/π, where π=(3π£/4)1/3 and π controls the semiaxes length ratios.Footnote1 These transforms are applied to ππΏ to define the initial resection cavity surface πE={πE,πΉ}, where πE={πS(ππ)βπR(ππr)(π£π£πΏπ)}πππ=1.
@fepegar Sorry I did not find that myself. This helps a lot, thanks!
No worries!
I am trying to use the resector.resect() function in python, where I want to cache all the inputs on beforehand (I need a new resection in every epoch of my model, and don't want to use imread for every instance of that). I mentioned that I can generate the gray matter and resectable masks from resector.parcellation. However, the python function also requires the inputs "sigma" and "radii". I am not sure what these parameters mean, and how I can generate them if necessary?