Open nsouedet opened 2 years ago
Ok, the issue is due to an implicit conversion from float to int in function VipConnectivityChamferErosion function, but the estimated chamfer size (based on volume voxel size) is less than one for BB339F image. So it is rounded to 0, which is not suitable for chamfer erosion size.
In fact, Check2DMorphoSizeConsistence returns ok for sizes over 0, but I think that VIP morpho functions that uses VipComputeFrontPropagationConnectivityDistanceMap all fails for sizes in [0, 1]
Another issue follows the first one. White ridges are not properly detected on BB339F data that makes fail the bias correction. This is because initiale gradient image used to process ridges is not correct
The reason is that not enough white matter is kept and the main connected component kept is one of the muscles.
A temporary simple solution may be to manually crop the data to remove the main muscle part
Describe the bug VipT1BiasCorrection ends with error 111 and many error messages.
To Reproduce Steps to reproduce the behavior:
Download files:
Extract BB339F.zip and baseline_mri_BB336F.zip content
In bv environment built on branch 5.0, run the command :
See standard output and error :
Reading AC, PC, IH coordinates: /home/Petri/BrainVISA/Issues/2022/2022-02-10-Primatologist_biascorrecorrection_issue/data/primatologist_test/subjects/BB339F/anatomical_mri/default_acquisition/BB339F.APC Reading Coordinate file (AC, PC...) Anterior commissure: 122 31 78 Posterior commissure: 121 45 86 Random interhemispheric point: 120 31 40 Computing 3D gradient x coord... Computing 3D gradient y coord... Computing 3D gradient z coord... Entering Extract3DMaxima (50 percent threshold: 26) Gradient image compression: 1 Determination of the background mean intensity... Computing 3D gradient x coord... Computing 3D gradient y coord... Computing 3D gradient z coord... edge magnitude minimum: 105 Tissue/background gradient threshold: 105 dist: 0.0 0.0 0.4 0.6 0.8 0.9 0.9 1.0 1.1
dist: 0.0 0.0 0.4 0.6 0.8 0.9 0.9 1.0 1.1
min_volume=0.000000
!! VIP Error: Negative or NULL limit value!
!! VIP Error:
Execution aborted in function '(distmap)VipComputeFrontPropagationConnectivityDistanceMap'.
!! VIP Error: Negative or NULL limit value!
!! VIP Error:
Execution aborted in function '(distmap)VipComputeFrontPropagationConnectivityDistanceMap'.
Corner background stats: mean: 21.038326; sigma: 48.774193 thbackground=70.312515
merge Corner background stats: mean: 50.721516; sigma: 65.039719 threshold for corner background/tissue: 116 dist: 1
dist: 1
Background stats: mean: 60.340893; sigma: 53.581482 Global threshold background/tissue: 168 Compute spatial variance... Deleting last 72 slices (95 percent threshold: 770) 8 Compressing volume (forgetting 3 bits)...
Low threshold: 21, High threshold: 100000 (after compression) Slice:239 238 237 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220 219 218 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 201 200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
strongest high threshold on variance: 36 dist: 1
crest gradient: mean: 8.283361; sigma: 5.007030 threshold gradient: 18 ridge gradient: mean: 8.294411; sigma: 4.077562 threshold gradient: 16 high threshold on variance: 30 (pourcentage: 75) dist: 1
carto copy full: vs: 0.449997, 0.800003, 0.449997
dist: 1 2
Max distance: 1.000000 mm OK dist: 1
Computing Bias with Kentropy = 1.000000, Kregularization = 20.000000, Kcrest = 20.000000 Koffset = 20.000000 Field sampling: 7x5x7 blocks of 35x19x35 voxels Number of points for computation: 349732/5358240 Entropy (in the range) before field correction: 5.704782 Range initial average: 48.856662, Initial standard deviation: 13.405333 (349732 points) With field : 49.015697, : 13.746180
!! VIP Error: Empty image
!! VIP Error:
Execution aborted in function 'VipComputeBiasFieldMultiGrid'.
Result Value returned = 111
The expected standard output and error:
Screenshots Not applicable
Environment:
Additional context Not applicable