My code pass “datatype_check” and “shape_check” and failed on “equation_output_check” which result in “Error: Wrong Output”.
My understand is that our code in function get_sub_volume should return a sub-volume that has background ratio less than background_threashold (default 0.95).
The test image has a 4x4x3, and the ask is to extract 2x2x2.
bgrd_ratio = np.sum(y[:, :, :, 0]) / (output_x * output_y * output_z)
so as long as any of the image label is not 0, we’ll have bgrd_ratio less than 0.95.
label for z=1 and z=2 are all 1 and 2. ( see below). so any of the 2x2x2 will not be all zero, hence will meet the background_threshold requirement.
However, the test code hard-coded to check for the following image set,
expected_output = (np.array([[[[1., 2.],
[2., 4.]],
[[2., 4.],
[4., 8.]]]]),
which is the center sub-volume and only the certer sub-volume. This logic does not make sense to me since other sub-volume should also pass. Do I misunderstand the problem or some concept? Thank you.
Label:
z = 0
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
z = 1
[[1. 1. 1. 1.]
[1. 1. 1. 1.]
[1. 1. 1. 1.]
[1. 1. 1. 1.]]
z = 2
[[2. 2. 2. 2.]
[2. 2. 2. 2.]
[2. 2. 2. 2.]
[2. 2. 2. 2.]]
Image:
z = 0
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
z = 1
[[0. 0. 0. 0.]
[0. 1. 2. 3.]
[0. 2. 4. 6.]
[0. 3. 6. 9.]]
z = 2
[[ 0. 0. 0. 0.]
[ 0. 2. 4. 6.]
[ 0. 4. 8. 12.]
[ 0. 6. 12. 18.]]