|
14 | 14 | Change directory to provide relative paths for doctests |
15 | 15 | >>> import os |
16 | 16 | >>> filepath = os.path.dirname( os.path.realpath( __file__ ) ) |
17 | | - >>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data')) |
| 17 | + >>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/\ |
| 18 | +data')) |
18 | 19 | >>> os.chdir(datadir) |
19 | 20 | """ |
20 | 21 |
|
@@ -102,40 +103,61 @@ class UnaryMaths(MathsCommand): |
102 | 103 | """Interface for executable seg_maths from NiftySeg platform. |
103 | 104 |
|
104 | 105 | Interface to use any unary mathematical operations that can be performed |
105 | | - with the seg_maths command-line program. See below for those operations: |
106 | | - -sqrt Square root of the image. |
107 | | - -exp Exponential root of the image. |
108 | | - -log Log of the image. |
109 | | - -recip Reciprocal (1/I) of the image. |
110 | | - -abs Absolute value of the image. |
111 | | - -bin Binarise the image. |
112 | | - -otsu Otsu thresholding of the current image. |
113 | | - -lconcomp Take the largest connected component |
114 | | - -concomp6 Label the different connected components with a 6NN |
115 | | - kernel |
116 | | - -concomp26 Label the different connected components with a 26NN |
117 | | - kernel |
118 | | - -fill Fill holes in binary object (e.g. fill ventricle in |
119 | | - brain mask). |
120 | | - -euc Euclidean distance trasnform |
121 | | - -tpmax Get the time point with the highest value (binarise 4D |
122 | | - probabilities) |
123 | | - -tmean Mean value of all time points. |
124 | | - -tmax Max value of all time points. |
125 | | - -tmin Mean value of all time points. |
126 | | - -splitlab Split the integer labels into multiple timepoints |
127 | | - -removenan Remove all NaNs and replace then with 0 |
128 | | - -isnan Binary image equal to 1 if the value is NaN and 0 |
129 | | - otherwise |
130 | | - -subsamp2 Subsample the image by 2 using NN sampling (qform and |
131 | | - sform scaled) |
132 | | - -scl Reset scale and slope info. |
133 | | - -4to5 Flip the 4th and 5th dimension. |
134 | | - -range Reset the image range to the min max |
135 | | -
|
136 | | - For source code, see http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg |
137 | | - For Documentation, see: |
138 | | - http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg_documentation |
| 106 | + with the seg_maths command-line program. |
| 107 | +
|
| 108 | + See below for those operations: |
| 109 | +
|
| 110 | + sqrt - Square root of the image). |
| 111 | +
|
| 112 | + exp - Exponential root of the image. |
| 113 | +
|
| 114 | + log - Log of the image. |
| 115 | +
|
| 116 | + recip - Reciprocal (1/I) of the image. |
| 117 | +
|
| 118 | + abs - Absolute value of the image. |
| 119 | +
|
| 120 | + bin - Binarise the image. |
| 121 | +
|
| 122 | + otsu - Otsu thresholding of the current image. |
| 123 | +
|
| 124 | + lconcomp - Take the largest connected component |
| 125 | +
|
| 126 | + concomp6 - Label the different connected components with a 6NN kernel |
| 127 | +
|
| 128 | + concomp26 - Label the different connected components with a 26NN kernel |
| 129 | +
|
| 130 | + fill - Fill holes in binary object (e.g. fill ventricle in brain mask). |
| 131 | +
|
| 132 | + euc - Euclidean distance trasnform |
| 133 | +
|
| 134 | + tpmax - Get the time point with the highest value (binarise 4D \ |
| 135 | +probabilities) |
| 136 | +
|
| 137 | + tmean - Mean value of all time points. |
| 138 | +
|
| 139 | + tmax - Max value of all time points. |
| 140 | +
|
| 141 | + tmin - Mean value of all time points. |
| 142 | +
|
| 143 | + splitlab - Split the integer labels into multiple timepoints |
| 144 | +
|
| 145 | + removenan - Remove all NaNs and replace then with 0 |
| 146 | +
|
| 147 | + isnan - Binary image equal to 1 if the value is NaN and 0 otherwise |
| 148 | +
|
| 149 | + subsamp2 - Subsample the image by 2 using NN sampling (qform and sform \ |
| 150 | +scaled) |
| 151 | +
|
| 152 | + scl - Reset scale and slope info. |
| 153 | +
|
| 154 | + 4to5 - Flip the 4th and 5th dimension. |
| 155 | +
|
| 156 | + range - Reset the image range to the min max. |
| 157 | +
|
| 158 | + `Source code <http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg>`_ | |
| 159 | + `Documentation <http://cmictig.cs.ucl.ac.uk/wiki/index.php/\ |
| 160 | +NiftySeg_documentation>`_ |
139 | 161 |
|
140 | 162 | Examples |
141 | 163 | -------- |
@@ -216,41 +238,58 @@ class BinaryMaths(MathsCommand): |
216 | 238 | """Interface for executable seg_maths from NiftySeg platform. |
217 | 239 |
|
218 | 240 | Interface to use any binary mathematical operations that can be performed |
219 | | - with the seg_maths command-line program. See below for those operations: |
220 | | - -mul <float/file> Multiply image <float> value or by other image. |
221 | | - -div <float/file> Divide image by <float> or by other image. |
222 | | - -add <float/file> Add image by <float> or by other image. |
223 | | - -sub <float/file> Subtract image by <float> or by other image. |
224 | | - -pow <float> Image to the power of <float>. |
225 | | - -thr <float> Threshold the image below <float>. |
226 | | - -uthr <float> Threshold image above <float>. |
227 | | - -smo <float> Gaussian smoothing by std <float> (in voxels |
228 | | - and up to 4-D). |
229 | | - -edge <float> Calculate the edges of the image using a |
230 | | - threshold <float>. |
231 | | - -sobel3 <float> Calculate the edges of all timepoints using a |
232 | | - Sobel filter with a 3x3x3 kernel and applying |
233 | | - <float> gaussian smoothing. |
234 | | - -sobel5 <float> Calculate the edges of all timepoints using a |
235 | | - Sobel filter with a 5x5x5 kernel and applying |
236 | | - <float> gaussian smoothing. |
237 | | - -min <file> Get the min per voxel between <current> and |
238 | | - <file>. |
239 | | - -smol <float> Gaussian smoothing of a 3D label image. |
240 | | - -geo <float/file> Geodesic distance according to the speed |
241 | | - function <float/file> |
242 | | - -llsnorm <file_norm> Linear LS normalisation between current and |
243 | | - <file_norm> |
244 | | - -masknan <file_norm> Assign everything outside the mask (mask==0) |
245 | | - with NaNs |
246 | | - -hdr_copy <file> Copy header from working image to <file> and |
247 | | - save in <output>. |
248 | | - -splitinter <x/y/z> Split interleaved slices in direction <x/y/z> |
249 | | - into separate time points |
250 | | -
|
251 | | - For source code, see http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg |
252 | | - For Documentation, see: |
253 | | - http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg_documentation |
| 241 | + with the seg_maths command-line program. |
| 242 | +
|
| 243 | + See below for those operations: |
| 244 | +
|
| 245 | + mul - <float/file> - Multiply image <float> value or by other image. |
| 246 | +
|
| 247 | + div - <float/file> - Divide image by <float> or by other image. |
| 248 | +
|
| 249 | + add - <float/file> - Add image by <float> or by other image. |
| 250 | +
|
| 251 | + sub - <float/file> - Subtract image by <float> or by other image. |
| 252 | +
|
| 253 | + pow - <float> - Image to the power of <float>. |
| 254 | +
|
| 255 | + thr - <float> - Threshold the image below <float>. |
| 256 | +
|
| 257 | + uthr - <float> - Threshold image above <float>. |
| 258 | +
|
| 259 | + smo - <float> - Gaussian smoothing by std <float> (in voxels and up to \ |
| 260 | +4-D). |
| 261 | +
|
| 262 | + edge - <float> - Calculate the edges of the image using a threshold <\ |
| 263 | +float>. |
| 264 | +
|
| 265 | + sobel3 - <float> - Calculate the edges of all timepoints using a Sobel \ |
| 266 | +filter with a 3x3x3 kernel and applying <float> gaussian smoothing. |
| 267 | +
|
| 268 | + sobel5 - <float> - Calculate the edges of all timepoints using a Sobel \ |
| 269 | +filter with a 5x5x5 kernel and applying <float> gaussian smoothing. |
| 270 | +
|
| 271 | + min - <file> - Get the min per voxel between <current> and <file>. |
| 272 | +
|
| 273 | + smol - <float> - Gaussian smoothing of a 3D label image. |
| 274 | +
|
| 275 | + geo - <float/file> - Geodesic distance according to the speed function \ |
| 276 | +<float/file> |
| 277 | +
|
| 278 | + llsnorm <file_norm> - Linear LS normalisation between current and \ |
| 279 | +<file_norm> |
| 280 | +
|
| 281 | + masknan <file_norm> - Assign everything outside the mask (mask==0) \ |
| 282 | +with NaNs |
| 283 | +
|
| 284 | + hdr_copy <file> - Copy header from working image to <file> and save in \ |
| 285 | +<output>. |
| 286 | +
|
| 287 | + splitinter <x/y/z> - Split interleaved slices in direction <x/y/z> into \ |
| 288 | +separate time points |
| 289 | +
|
| 290 | + `Source code <http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg>`_ | |
| 291 | + `Documentation <http://cmictig.cs.ucl.ac.uk/wiki/index.php/\ |
| 292 | +NiftySeg_documentation>`_ |
254 | 293 |
|
255 | 294 | Examples |
256 | 295 | -------- |
@@ -348,19 +387,25 @@ class BinaryMathsInteger(MathsCommand): |
348 | 387 | """Interface for executable seg_maths from NiftySeg platform. |
349 | 388 |
|
350 | 389 | Interface to use any integer mathematical operations that can be performed |
351 | | - with the seg_maths command-line program. See below for those operations: |
352 | | - (requiring integer values) |
353 | | - -equal <int> Get voxels equal to <int> |
354 | | - -dil <int> Dilate the image <int> times (in voxels). |
355 | | - -ero <int> Erode the image <int> times (in voxels). |
356 | | - -tp <int> Extract time point <int> |
357 | | - -crop <int> Crop <int> voxels around each 3D volume. |
358 | | - -pad <int> Pad <int> voxels with NaN value around each 3D |
359 | | - volume. |
360 | | -
|
361 | | - For source code, see http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg |
362 | | - For Documentation, see: |
363 | | - http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg_documentation |
| 390 | + with the seg_maths command-line program. |
| 391 | +
|
| 392 | + See below for those operations: (requiring integer values) |
| 393 | +
|
| 394 | + equal - <int> - Get voxels equal to <int> |
| 395 | +
|
| 396 | + dil - <int> - Dilate the image <int> times (in voxels). |
| 397 | +
|
| 398 | + ero - <int> - Erode the image <int> times (in voxels). |
| 399 | +
|
| 400 | + tp - <int> - Extract time point <int> |
| 401 | +
|
| 402 | + crop - <int> - Crop <int> voxels around each 3D volume. |
| 403 | +
|
| 404 | + pad - <int> - Pad <int> voxels with NaN value around each 3D volume. |
| 405 | +
|
| 406 | + `Source code <http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg>`_ | |
| 407 | + `Documentation <http://cmictig.cs.ucl.ac.uk/wiki/index.php/\ |
| 408 | +NiftySeg_documentation>`_ |
364 | 409 |
|
365 | 410 | Examples |
366 | 411 | -------- |
@@ -436,17 +481,22 @@ class TupleMaths(MathsCommand): |
436 | 481 | """Interface for executable seg_maths from NiftySeg platform. |
437 | 482 |
|
438 | 483 | Interface to use any tuple mathematical operations that can be performed |
439 | | - with the seg_maths command-line program. See below for those operations: |
440 | | - -lncc <file> <std> Local CC between current img and <file> |
441 | | - on a kernel with <std> |
442 | | - -lssd <file> <std> Local SSD between current img and <file> |
443 | | - on a kernel with <std> |
444 | | - -lltsnorm <file_norm> <float> Linear LTS normalisation assuming |
445 | | - <float> percent outliers |
446 | | -
|
447 | | - For source code, see http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg |
448 | | - For Documentation, see: |
449 | | - http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg_documentation |
| 484 | + with the seg_maths command-line program. |
| 485 | +
|
| 486 | + See below for those operations: |
| 487 | +
|
| 488 | + lncc <file> <std> Local CC between current img and <file> on a kernel \ |
| 489 | +with <std> |
| 490 | +
|
| 491 | + lssd <file> <std> Local SSD between current img and <file> on a kernel \ |
| 492 | +with <std> |
| 493 | +
|
| 494 | + lltsnorm <file_norm> <float> Linear LTS normalisation assuming <float> \ |
| 495 | +percent outliers |
| 496 | +
|
| 497 | + `Source code <http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg>`_ | |
| 498 | + `Documentation <http://cmictig.cs.ucl.ac.uk/wiki/index.php/\ |
| 499 | +NiftySeg_documentation>`_ |
450 | 500 |
|
451 | 501 | Examples |
452 | 502 | -------- |
@@ -504,13 +554,16 @@ class Merge(MathsCommand): |
504 | 554 | """Interface for executable seg_maths from NiftySeg platform. |
505 | 555 |
|
506 | 556 | Interface to use the merge operation that can be performed |
507 | | - with the seg_maths command-line program. See below for this option: |
508 | | - -merge <i> <d> <files> Merge <i> images and the working image in the |
509 | | - <d> dimension |
| 557 | + with the seg_maths command-line program. |
| 558 | +
|
| 559 | + See below for this option: |
| 560 | +
|
| 561 | + merge <i> <d> <files> Merge <i> images and the working image in the \ |
| 562 | +<d> dimension |
510 | 563 |
|
511 | | - For source code, see http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg |
512 | | - For Documentation, see: |
513 | | - http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg_documentation |
| 564 | + `Source code <http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftySeg>`_ | |
| 565 | + `Documentation <http://cmictig.cs.ucl.ac.uk/wiki/index.php/\ |
| 566 | +NiftySeg_documentation>`_ |
514 | 567 |
|
515 | 568 | Examples |
516 | 569 | -------- |
|
0 commit comments