Open liyunkai-carpediem opened 1 year ago
Hi @liyunkai-carpediem. You can just search for the code:
Dear sir, Thanks a lot for giving me an answer, I am very excited!!! And I have found the relative codes in the following path: "scripts/test/perlin_sphere.py" I think they are the same(?)
when I run the following code, I have noticed that there are 5 shapes generated. Which one will be the final shape I will be used later?
for _ in range(5):
offset = np.random.randint(1000)
output_path = f'/tmp/geodesic_polyhedron_noise_{offset}.vtp'
volume = np.random.randint(100, 10000)
center = np.random.randint(-50, 50, size=(3))
k = 4/3 * np.pi
radius = (volume / k) ** (1/3)
ratio = np.random.uniform(0.8, 1)
a = radius
b = radius * ratio
c = radius / ratio
radii = a, b, c
angles = np.random.uniform(0, 180, size=3)
output_poly_data = get_resection_poly_data(
input_poly_data,
offset,
center,
radii,
angles,
)
Thanks a lot.
When I run the mesh_to_vol, I met some problems. My code is here:
from resector.io import read_poly_data, write
from resector.mesh import mesh_to_volume
mesh_path = '/storage/liyunkai/resector-master/geodesic_polyhedron_noise_102.vtp'
reference_path = '/storage/liyunkai/MICCAI_FeTS2022_TrainingData/FeTS2022_00000/FeTS2022_00000_seg.nii.gz'
poly_data = read_poly_data(mesh_path)
image = mesh_to_volume(poly_data, reference_path)
write(image, '/storage/liyunkai/resector-master/result/stenciled.nii.gz')
And the error is:
/storage/liyunkai/resector-master/resector/mesh.py:281: UserWarning: Empty stencil mask for reference /tmp/tmpub2oik3h.nii
warnings.warn(f'Empty stencil mask for reference {reference_path}')
the file is empty, but how?
Description
I want to delve into the code and not run it as pre-packaged methods. I have found the generated geodesic polyhedron and I would like to ask which part of the code is responsible for adding simplex noise to it , as well as the code for random affine transformations.