3.10.1.21.1.3. opengate.tests.utility¶
3.10.1.21.1.3.1. Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Return a branch whether it is a numpy or a uproot tree |
|
Compare with Wasserstein distance |
|
Compare with Wasserstein distance |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Compare two root trees. |
|
|
return "auto" except if the test runs with macos and github actions |
|
|
Clip and rescale the grey level values of the image according to window width/level. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3.10.1.21.1.3.2. Module Contents¶
- opengate.tests.utility.assert_images(ref_filename1, filename2, stats=None, tolerance=0, ignore_value=0, axis='z', fig_name=None, sum_tolerance=5, scaleImageValuesFactor=None)[source]¶
- opengate.tests.utility.assert_filtered_imagesprofile1D(ref_filter_filename1, ref_filename1, filename2, stats=None, tolerance=0, ignore_value=0, fig_name=None, sum_tolerance=5, plt_ylim=None)[source]¶
- opengate.tests.utility.get_branch(tree, keys, key)[source]¶
Return a branch whether it is a numpy or a uproot tree
- opengate.tests.utility.compare_branches(tree1, keys1, tree2, keys2, key1, key2, tol=0.8, scaling1=1, scaling2=1, ax=False, nb_bins=200)[source]¶
Compare with Wasserstein distance Works well, but not easy to set the tolerance value.
- opengate.tests.utility.compare_branches_values(b1, b2, key1, key2, tol=0.8, ax=False, nb_bins=200)[source]¶
Compare with Wasserstein distance Works well, but not easy to set the tolerance value.
- opengate.tests.utility.compare_trees(tree1, allkeys1, tree2, allkeys2, keys1, keys2, tols, scalings1, scalings2, fig=False, nb_bins=200)[source]¶
- opengate.tests.utility.compare_root2(root1, root2, branch1, branch2, keys, img_filename, n_tol=3)[source]¶
- opengate.tests.utility.compare_root3(root1, root2, branch1, branch2, keys1, keys2, tols, scalings1, scalings2, img, hits_tol=6, nb_bins=200)[source]¶
- opengate.tests.utility.write_gauss_param_to_file(outputdir, planePositionsV, saveFig=False, fNamePrefix='plane', fNameSuffix='a.mhd')[source]¶
- opengate.tests.utility.get_gauss_param_xy(data, spacing, shape, filepath=None, saveFig=False)[source]¶
- opengate.tests.utility.extract_gauss_param_1D(data, length, spacing, axis=1, createFig=False)[source]¶
- opengate.tests.utility.compareGaussParamFromFile(sigma, ref, rel_tol=0, abs_tol=0, verb=False)[source]¶
- opengate.tests.utility.compareGaussParamArrays(paramTestV, paramRefV, rel_tol=0, abs_tol=0, verb=False)[source]¶
- opengate.tests.utility.test_tps_spot_size_positions(data, ref, spacing, thresh=0.1, abs_tol=0.3)[source]¶
- opengate.tests.utility.compareRange(volume1, volume2, shape1, shape2, spacing1, spacing2, axis1='y', axis2='y', thresh=2.0)[source]¶
- opengate.tests.utility.compare_dose_at_points(pointsV, dose1, dose2, shape1, shape2, spacing1, spacing2, axis1='z', axis2='z', rel_tol=0.03)[source]¶
- opengate.tests.utility.root_compare4(p1, p2, param)[source]¶
Compare two root trees.
p1 and p2 contain = the root filename, the tree name, a list of branch names (see root_compare_param_tree) Also, each branch can be scaled and clip to a min/max range.
param contains: the tolerance values (for all branches), the fig name, the nb of bins of the histograms, the tolerance for the nb of hits (see root_compare_param)
- opengate.tests.utility.get_gpu_mode_for_tests()[source]¶
return “auto” except if the test runs with macos and github actions On macos and github actions, mps is detected but not usable and lead to errors. So we choose “cpu” in such a case
- opengate.tests.utility.np_img_window_level(img, window_width, window_level)[source]¶
Clip and rescale the grey level values of the image according to window width/level. Output image is within the range [0, 1]
3.10.1.21.1.3. Parameters¶
img an image as a numpy array window_width window_level
3.10.1.21.1.3. Returns the clipped and normalized image (range [0, 1])¶
- opengate.tests.utility.np_plot_slice(ax, img, num_slice, window_width, window_level, crop_center, crop_width, spacing=(1, 1))[source]¶
- opengate.tests.utility.np_plot_integrated_profile(ax, img, axis, num_slice, crop_center, crop_width, label, spacing)[source]¶
- opengate.tests.utility.np_plot_profile_X(ax, img, hline, num_slice, crop_center, crop_width, label, width)[source]¶