Module gwy
[hide private]
[frames] | no frames]

Source Code for Module gwy

    1  # vim: set fileencoding=utf-8 : 
    2  # This is dummy GENERATED file used for generation of documentation 
    3   
4 -class Axis:
5 - def __init__(orientation):
6 """ 7 Creates a new axis. 8 9 10 @param orientation: axis orientation I{(int)} 11 @return: New axis as a B{C{GtkWidget}}. I{(L{gtk.Widget})} 12 """ 13 return None
14
15 - def set_logarithmic(is_logarithmic):
16 """ 17 Sets logarithmic mode. 18 19 @param is_logarithmic: logarithmic mode I{(bool)} 20 """ 21 pass
22
23 - def set_visible(is_visible):
24 """ 25 Sets the visibility of an axis. 26 27 @param is_visible: visibility I{(bool)} 28 """ 29 pass
30
31 - def is_visible():
32 """ 33 Determines whether axis is set to be visible. 34 35 Return: B{C{True}} if B{C{axis}} is set to be visible. 36 37 @return: I{(bool)} 38 """ 39 return None
40
41 - def is_logarithmic():
42 """ 43 Determines whether axis is set to be locarithmic. 44 45 46 @return: B{C{True}} if B{C{axis}} is logarithmic. I{(bool)} 47 """ 48 return None
49
50 - def get_orientation():
51 """ 52 Gets the orientation of an axis. 53 54 55 @return: The orientation. I{(GtkPositionType)} 56 """ 57 return None
58
59 - def set_auto(is_auto):
60 """ 61 Enables or disables automatic axis adjustmet. 62 63 @param is_auto: B{C{True}} to enable automatic tick size and distribution adjustment, 64 B{C{False}} to disable it. I{(bool)} 65 """ 66 pass
67
68 - def request_range(min, max):
69 """ 70 Sets the requisition of axis boundaries. 71 72 The axis will adjust the boundaries to satisfy requisition but still have 73 reasonable tick values and spacing. Use L{Axis.get_range}() to obtain the 74 boundaries the axis actually decided to use. 75 76 @param min: Minimum requisition (min boundary value). I{(float)} 77 @param max: Maximum requisition (max boundary value). I{(float)} 78 """ 79 pass
80
81 - def get_range():
82 """ 83 Gets the actual boundaries of an axis. 84 85 @return: Tuple consisting of 2 values (B{C{min}}, B{C{max}}). (I{(float)}, I{(float)}) 86 """ 87 return None, None
88
90 """ 91 Gets the requested boundaries of an axis. 92 93 @return: Tuple consisting of 2 values (B{C{min}}, B{C{max}}). (I{(float)}, I{(float)}) 94 """ 95 return None, None
96
97 - def get_magnification():
98 """ 99 Gets the magnification value of a graph axis. 100 101 102 @return: Magnification value of the axis. I{(float)} 103 """ 104 return None
105
107 """ 108 Gets the magnification string of an axis. 109 110 111 @return: Magnification string of the axis, owned by the axis. I{(string)} 112 """ 113 return None
114
115 - def set_label(label):
116 """ 117 Sets the label text of an axis. 118 119 @param label: The new label text (it can be B{C{None}} for an empty label). I{(string)} 120 """ 121 pass
122
123 - def get_label():
124 """ 125 Gets the label of an axis. 126 127 128 @return: Axis label as a string owned by B{C{axis}}. I{(string)} 129 """ 130 return None
131
132 - def set_si_unit(unit):
133 """ 134 Sets the axis unit. This will be added automatically 135 to the label. B{C{unit}} is duplicated. 136 137 @param unit: axis unit I{(L{SIUnit})} 138 """ 139 pass
140
141 - def enable_label_edit(enable):
142 """ 143 Enables/disables user to change axis label by clicking on axis widget. 144 145 @param enable: enable/disable user to change axis label I{(bool)} 146 """ 147 pass
148
149 - def draw_on_drawable(drawable, gc, xmin, ymin, width, height):
150 """ 151 Draws the x and y-axis on a drawable 152 153 @param drawable: Drawable to draw on. I{(L{gdk.Drawable})} 154 @param gc: Graphics context. 155 It is modified by this function unpredictably. I{(L{gdk.GC})} 156 @param xmin: The minimum x-axis value. I{(int)} 157 @param ymin: The minimum y-axis value. I{(int)} 158 @param width: The width of the x-axis. I{(int)} 159 @param height: The height of the y-axis. I{(int)} 160 """ 161 pass
162
163 - def export_vector(xmin, ymin, width, height, fontsize):
164 """ 165 Renders a graph axis in PostScript. 166 167 This is a helper functions for L{Graph.export_postscript}() and probably 168 not useful anywhere else. 169 170 171 @param xmin: Left edge of the bounding rectangle. I{(int)} 172 @param ymin: Bottom edge of the bounding rectangle. I{(int)} 173 @param width: Width of the bounding rectangle. I{(int)} 174 @param height: Height of the bounding rectangle. I{(int)} 175 @param fontsize: Font size to use. I{(int)} 176 @return: A newly created B{C{GString}}. I{(string)} 177 """ 178 return None
179
180 - def get_major_ticks():
181 """ 182 Gets the positions of major ticks of an axis. 183 184 185 @return: The positions of axis major ticks (as real values, not pixels). 186 The returned array is owned by the axis. I{(list)} 187 """ 188 return None
189 190
191 -class Brick:
192 """ 193 Three-dimensional data representation 194 195 196 B{C{Brick}} represents 3D data arrays in Gwyddion. It is typically useful for 197 different volume data obtained from SPMs, like in force volume measurements. 198 199 """
200 - def __init__(xres, yres, zres, xreal, yreal, zreal, nullme):
201 """ 202 Creates a new data brick. 203 204 @since: 2.31 205 206 @param xres: X resolution, i.e., the number of samples in x direction I{(int)} 207 @param yres: Y resolution, i.e., the number of samples in y direction I{(int)} 208 @param zres: Z resolution, i.e., the number of samples in z direction I{(int)} 209 @param xreal: Real physical dimension in x direction. I{(float)} 210 @param yreal: Real physical dimension in y direction. I{(float)} 211 @param zreal: Real physical dimension in z direction. I{(float)} 212 @param nullme: Whether the data brick should be initialized to zeroes. If B{C{False}}, 213 the data will not be initialized. I{(bool)} 214 @return: A newly created data brick. I{(L{Brick})} 215 """ 216 return None
217
218 - def new_alike(nullme):
219 """ 220 Creates a new data brick similar to an existing one. 221 222 Use L{Brick.duplicate}() if you want to copy a data brick including 223 data. 224 225 @since: 2.31 226 227 @param nullme: Whether the data brick should be initialized to zeroes. If B{C{False}}, 228 the data will not be initialized. I{(bool)} 229 @return: A newly created data brick. I{(L{Brick})} 230 """ 231 return None
232
233 - def new_part(xpos, ypos, zpos, xres, yres, zres, keep_offsets):
234 """ 235 Creates a new data brick as a part of existing one. 236 237 Use L{Brick.duplicate}() if you want to copy a whole data brick. 238 239 @since: 2.32 240 241 @param xpos: x position where to start from I{(int)} 242 @param ypos: y position where to start from I{(int)} 243 @param zpos: z position where to start from I{(int)} 244 @param xres: x resolution (width) to be extracted I{(int)} 245 @param yres: y resolution (height) to be extracted I{(int)} 246 @param zres: z resolution (depth) to be extracted I{(int)} 247 @param keep_offsets: keep offsets of data during extraction I{(bool)} 248 @return: A newly created data brick. I{(L{Brick})} 249 """ 250 return None
251
252 - def data_changed():
253 """ 254 Emits signal "data_changed" on a data brick. 255 256 @since: 2.31 257 258 """ 259 pass
260
261 - def resample(xres, yres, zres, interpolation):
262 """ 263 Resamples a data brick. 264 265 In other words changes the size of three dimensional field related with data 266 brick. The original values are used for resampling using a requested 267 interpolation alorithm. 268 269 @since: 2.31 270 271 @param xres: Desired x resolution. I{(int)} 272 @param yres: Desired y resolution. I{(int)} 273 @param zres: Desired z resolution. I{(int)} 274 @param interpolation: Interpolation method to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 275 """ 276 pass
277
278 - def get_xres():
279 """ 280 Gets the x resolution of a data brick. 281 282 @since: 2.31 283 284 @return: Resolution (number of data points). I{(int)} 285 """ 286 return None
287
288 - def get_yres():
289 """ 290 Gets the y resolution of a data brick. 291 292 @since: 2.31 293 294 @return: Resolution (number of data points). I{(int)} 295 """ 296 return None
297
298 - def get_zres():
299 """ 300 Gets the z resolution of a data brick. 301 302 @since: 2.31 303 304 @return: Resolution (number of data points). I{(int)} 305 """ 306 return None
307
308 - def get_xreal():
309 """ 310 Gets the physical size of a data brick in the x direction. 311 312 @since: 2.31 313 314 @return: Real size of a data brick the x direction. I{(float)} 315 """ 316 return None
317
318 - def get_yreal():
319 """ 320 Gets the physical size of a data brick in the y direction. 321 322 @since: 2.31 323 324 @return: Real size of a data brick the y direction. I{(float)} 325 """ 326 return None
327
328 - def get_zreal():
329 """ 330 Gets the physical size of a data brick in the z direction. 331 332 @since: 2.31 333 334 @return: Real size of a data brick the z direction. I{(float)} 335 """ 336 return None
337
338 - def get_xoffset():
339 """ 340 Gets the offset of data brick origin in x direction. 341 342 @since: 2.31 343 344 @return: Offset value. I{(float)} 345 """ 346 return None
347
348 - def get_yoffset():
349 """ 350 Gets the offset of data brick origin in y direction. 351 352 @since: 2.31 353 354 @return: Offset value. I{(float)} 355 """ 356 return None
357
358 - def get_zoffset():
359 """ 360 Gets the offset of data brick origin in z direction. 361 362 @since: 2.31 363 364 @return: Offset value. I{(float)} 365 """ 366 return None
367
368 - def set_xreal(xreal):
369 """ 370 Sets the real x dimension of a brick. 371 372 @since: 2.31 373 374 @param xreal: New real x dimensions value I{(float)} 375 """ 376 pass
377
378 - def set_yreal(yreal):
379 """ 380 Sets the real y dimension of a brick. 381 382 @since: 2.31 383 384 @param yreal: New real y dimensions value I{(float)} 385 """ 386 pass
387
388 - def set_zreal(zreal):
389 """ 390 Sets the real z dimension of a brick. 391 392 @since: 2.31 393 394 @param zreal: New real z dimensions value I{(float)} 395 """ 396 pass
397
398 - def set_xoffset(xoffset):
399 """ 400 Sets the offset of a data brick origin in the x direction. 401 402 Note offsets don't affect any calculation, nor functions like 403 L{Brick.rtoi}(). 404 405 @since: 2.31 406 407 @param xoffset: New offset value. I{(float)} 408 """ 409 pass
410
411 - def set_yoffset(yoffset):
412 """ 413 Sets the offset of a data brick origin in the y direction. 414 415 Note offsets don't affect any calculation, nor functions like 416 L{Brick.rtoi}(). 417 418 @since: 2.31 419 420 @param yoffset: New offset value. I{(float)} 421 """ 422 pass
423
424 - def set_zoffset(zoffset):
425 """ 426 Sets the offset of a data brick origin in the z direction. 427 428 Note offsets don't affect any calculation, nor functions like 429 L{Brick.rtoi}(). 430 431 @since: 2.31 432 433 @param zoffset: New offset value. I{(float)} 434 """ 435 pass
436
437 - def get_si_unit_x():
438 """ 439 Returns x direction SI unit of a data brick. 440 441 @since: 2.31 442 443 @return: SI unit corresponding to the lateral (X) dimension of the data 444 brick. Its reference count is not incremented. I{(L{SIUnit})} 445 """ 446 return None
447
448 - def get_si_unit_y():
449 """ 450 Returns y direction SI unit of a data brick. 451 452 @since: 2.31 453 454 @return: SI unit corresponding to the lateral (Y) dimension of the data 455 brick. Its reference count is not incremented. I{(L{SIUnit})} 456 """ 457 return None
458
459 - def get_si_unit_z():
460 """ 461 Returns z direction SI unit of a data brick. 462 463 @since: 2.31 464 465 @return: SI unit corresponding to the "height" (Z) dimension of the data 466 brick. Its reference count is not incremented. I{(L{SIUnit})} 467 """ 468 return None
469
470 - def get_si_unit_w():
471 """ 472 Returns value SI unit of a data brick. 473 474 @since: 2.31 475 476 @return: SI unit corresponding to the "value" of the data 477 brick. Its reference count is not incremented. I{(L{SIUnit})} 478 """ 479 return None
480
481 - def set_si_unit_x(si_unit):
482 """ 483 Sets the SI unit corresponding to the lateral (X) dimension of a data 484 brick. 485 486 It does not assume a reference on B{C{si_unit}}, instead it adds its own 487 reference. 488 489 @since: 2.31 490 491 @param si_unit: SI unit to be set. I{(L{SIUnit})} 492 """ 493 pass
494
495 - def set_si_unit_y(si_unit):
496 """ 497 Sets the SI unit corresponding to the lateral (Y) dimension of a data 498 brick. 499 500 It does not assume a reference on B{C{si_unit}}, instead it adds its own 501 reference. 502 503 @since: 2.31 504 505 @param si_unit: SI unit to be set. I{(L{SIUnit})} 506 """ 507 pass
508
509 - def set_si_unit_z(si_unit):
510 """ 511 Sets the SI unit corresponding to the "height" (Z) dimension of a data 512 brick. 513 514 It does not assume a reference on B{C{si_unit}}, instead it adds its own 515 reference. 516 517 @since: 2.31 518 519 @param si_unit: SI unit to be set. I{(L{SIUnit})} 520 """ 521 pass
522
523 - def set_si_unit_w(si_unit):
524 """ 525 Sets the SI unit corresponding to the "value" of a data 526 brick. 527 528 It does not assume a reference on B{C{si_unit}}, instead it adds its own 529 reference. 530 531 @since: 2.31 532 533 @param si_unit: SI unit to be set. I{(L{SIUnit})} 534 """ 535 pass
536
537 - def get_min():
538 """ 539 Find the minimum value in a data brick. 540 541 @since: 2.31 542 543 @return: The minimum value within the brick. I{(float)} 544 """ 545 return None
546
547 - def get_max():
548 """ 549 Find the maximum value in a data brick. 550 551 @since: 2.31 552 553 @return: The maximum value within the brick. I{(float)} 554 """ 555 return None
556
557 - def copy_units(target):
558 """ 559 Sets lateral and value units of a data brick to match another data brick. 560 561 @since: 2.49 562 563 @param target: Target data brick. I{(L{Brick})} 564 """ 565 pass
566
567 - def get_value_format_x(style):
568 """ 569 Finds value format good for displaying coordinates of a data brick. 570 571 @since: 2.31 572 573 @param style: Unit format style. Expected values: C{B{SI_UNIT_FORMAT_NONE}}, C{B{SI_UNIT_FORMAT_PLAIN}}, C{B{SI_UNIT_FORMAT_MARKUP}}, C{B{SI_UNIT_FORMAT_VFMARKUP}}, C{B{SI_UNIT_FORMAT_TEX}}, C{B{SI_UNIT_FORMAT_VFTEX}}, C{B{SI_UNIT_FORMAT_UNICODE}}, C{B{SI_UNIT_FORMAT_VFUNICODE}}. I{(L{SIUnitFormatStyle})} 574 @return: Tuple consisting of 2 values (B{C{value}}, B{C{format}}). (I{(L{SIValueFormat})}, I{(SkipArg)}) 575 """ 576 return None, None
577
578 - def get_value_format_y(style):
579 """ 580 Finds value format good for displaying values of a data brick. 581 582 @since: 2.31 583 584 @param style: Unit format style. Expected values: C{B{SI_UNIT_FORMAT_NONE}}, C{B{SI_UNIT_FORMAT_PLAIN}}, C{B{SI_UNIT_FORMAT_MARKUP}}, C{B{SI_UNIT_FORMAT_VFMARKUP}}, C{B{SI_UNIT_FORMAT_TEX}}, C{B{SI_UNIT_FORMAT_VFTEX}}, C{B{SI_UNIT_FORMAT_UNICODE}}, C{B{SI_UNIT_FORMAT_VFUNICODE}}. I{(L{SIUnitFormatStyle})} 585 @return: Tuple consisting of 2 values (B{C{value}}, B{C{format}}). (I{(L{SIValueFormat})}, I{(SkipArg)}) 586 """ 587 return None, None
588
589 - def get_value_format_z(style):
590 """ 591 Finds value format good for displaying values of a data brick. 592 593 @since: 2.31 594 595 @param style: Unit format style. Expected values: C{B{SI_UNIT_FORMAT_NONE}}, C{B{SI_UNIT_FORMAT_PLAIN}}, C{B{SI_UNIT_FORMAT_MARKUP}}, C{B{SI_UNIT_FORMAT_VFMARKUP}}, C{B{SI_UNIT_FORMAT_TEX}}, C{B{SI_UNIT_FORMAT_VFTEX}}, C{B{SI_UNIT_FORMAT_UNICODE}}, C{B{SI_UNIT_FORMAT_VFUNICODE}}. I{(L{SIUnitFormatStyle})} 596 @return: Tuple consisting of 2 values (B{C{value}}, B{C{format}}). (I{(L{SIValueFormat})}, I{(SkipArg)}) 597 """ 598 return None, None
599
600 - def get_value_format_w(style):
601 """ 602 Finds value format good for displaying values of a data brick. 603 604 Note this functions searches for minimum and maximum value in B{C{brick}}, 605 therefore it's relatively slow. 606 607 @since: 2.31 608 609 @param style: Unit format style. Expected values: C{B{SI_UNIT_FORMAT_NONE}}, C{B{SI_UNIT_FORMAT_PLAIN}}, C{B{SI_UNIT_FORMAT_MARKUP}}, C{B{SI_UNIT_FORMAT_VFMARKUP}}, C{B{SI_UNIT_FORMAT_TEX}}, C{B{SI_UNIT_FORMAT_VFTEX}}, C{B{SI_UNIT_FORMAT_UNICODE}}, C{B{SI_UNIT_FORMAT_VFUNICODE}}. I{(L{SIUnitFormatStyle})} 610 @return: Tuple consisting of 2 values (B{C{value}}, B{C{format}}). (I{(L{SIValueFormat})}, I{(SkipArg)}) 611 """ 612 return None, None
613
614 - def itor(pixpos):
615 """ 616 Transforms pixel coordinate to real (physical) coordinate in x direction. 617 618 That is it maps range [0..x resolution] to range [0..x real-size]. It is not 619 suitable for conversion of matrix indices to physical coordinates, you 620 have to use L{Brick.itor}(B{C{brick}}, B{C{pixpos}} + 0.5) for that. 621 622 @since: 2.31 623 624 @param pixpos: Pixel coordinate. I{(float)} 625 @return: B{C{pixpos}} in real coordinates. I{(float)} 626 """ 627 return None
628
629 - def rtoi(realpos):
630 """ 631 Transforms real (physical) coordinate to pixel coordinate in x axis. 632 633 That is it maps range [0..x real-size] to range [0..x resolution]. 634 635 @since: 2.31 636 637 @param realpos: Real coordinate. I{(float)} 638 @return: B{C{realpos}} in pixel coordinates. I{(float)} 639 """ 640 return None
641
642 - def jtor(pixpos):
643 """ 644 Transforms pixel coordinate to real (physical) coordinate in y direction. 645 646 That is it maps range [0..y resolution] to range [0..y real-size]. It is not 647 suitable for conversion of matrix indices to physical coordinates, you 648 have to use L{Brick.itor}(B{C{brick}}, B{C{pixpos}} + 0.5) for that. 649 650 @since: 2.31 651 652 @param pixpos: Pixel coordinate. I{(float)} 653 @return: B{C{pixpos}} in real coordinates. I{(float)} 654 """ 655 return None
656
657 - def rtoj(realpos):
658 """ 659 Transforms real (physical) coordinate to pixel coordinate in y axis. 660 661 That is it maps range [0..y real-size] to range [0..y resolution]. 662 663 @since: 2.31 664 665 @param realpos: Real coordinate. I{(float)} 666 @return: B{C{realpos}} in pixel coordinates. I{(float)} 667 """ 668 return None
669
670 - def ktor(pixpos):
671 """ 672 Transforms pixel coordinate to real (physical) coordinate in z direction. 673 674 That is it maps range [0..z resolution] to range [0..z real-size]. It is not 675 suitable for conversion of matrix indices to physical coordinates, you 676 have to use L{Brick.itor}(B{C{brick}}, B{C{pixpos}} + 0.5) for that. 677 678 @since: 2.31 679 680 @param pixpos: Pixel coordinate. I{(float)} 681 @return: B{C{pixpos}} in real coordinates. I{(float)} 682 """ 683 return None
684
685 - def rtok(realpos):
686 """ 687 Transforms real (physical) coordinate to pixel coordinate in z axis. 688 689 That is it maps range [0..z real-size] to range [0..z resolution]. 690 691 @since: 2.31 692 693 @param realpos: Real coordinate. I{(float)} 694 @return: B{C{realpos}} in pixel coordinates. I{(float)} 695 """ 696 return None
697
698 - def ktor_cal(pixpos):
699 """ 700 Transforms pixel coordinate to real (physical) coordinate in z direction, 701 taking into account calibration. 702 703 Unlike L{Brick.ktor}(), this function takes into account the B{C{z}} 704 calibration and, if calibration is not present, the B{C{z}} axis offset. 705 Since the calibration is available only for discrete pixel coordinates, 706 the values are interpolated between and clamped if outside the range. 707 708 The values in the calibration are assumed to correspond to pixel centres. 709 This convention is also kept when no calibration is present. 710 711 @since: 2.42 712 713 @param pixpos: Pixel coordinate. I{(float)} 714 @return: B{C{pixpos}} in real coordinates. I{(float)} 715 """ 716 return None
717
718 - def rtok_cal(realpos):
719 """ 720 Transforms real (physical) coordinate to pixel coordinate in z axis, 721 taking into account calibration. 722 723 Unlike L{Brick.rtok}(), this function takes into account the B{C{z}} 724 calibration and, if calibration is not present, the B{C{z}} axis offset. 725 Since the calibration is available only for discrete pixel coordinates, 726 the values are interpolated between and clamped if outside the range. 727 728 The values in the calibration are assumed to correspond to pixel centres. 729 This convention is also kept when no calibration is present. 730 731 @since: 2.42 732 733 @param realpos: Real coordinate. I{(float)} 734 @return: B{C{realpos}} in pixel coordinates. I{(float)} 735 """ 736 return None
737
738 - def get_val(col, row, lev):
739 """ 740 Gets value at given position in a data brick. 741 742 Do not access data with this function inside inner loops, it's slow. 743 Get raw data buffer with L{Brick.get_data_const}() and access it 744 directly instead. 745 746 @since: 2.31 747 748 @param col: Position in the brick (column index). I{(int)} 749 @param row: Position in the brick (row index). I{(int)} 750 @param lev: Position in the brick (level index). I{(int)} 751 @return: Value at given index. I{(float)} 752 """ 753 return None
754
755 - def set_val(col, row, lev, value):
756 """ 757 Sets value at given position in a data brick. 758 759 Do not access data with this function inside inner loops, it's slow. 760 Get raw data buffer with L{Brick.get_data_const}() and access it 761 directly instead. 762 763 @since: 2.31 764 765 @param col: Position in the brick (column index). I{(int)} 766 @param row: Position in the brick (row index). I{(int)} 767 @param lev: Position in the brick (level index). I{(int)} 768 @param value: Value to be set. I{(float)} 769 """ 770 pass
771
772 - def get_val_real(x, y, z):
773 """ 774 Gets value at given position in a data brick, in real coordinates. 775 776 Do not access data with this function inside inner loops, it's slow. 777 Get raw data buffer with L{Brick.get_data_const}() and access it 778 directly instead. 779 780 @since: 2.31 781 782 @param x: Position in the brick (x direction). I{(float)} 783 @param y: Position in the brick (y direction). I{(float)} 784 @param z: Position in the brick (z direction). I{(float)} 785 @return: Value at given index. I{(float)} 786 """ 787 return None
788
789 - def set_val_real(x, y, z, value):
790 """ 791 Sets value at given position in a data brick. 792 793 Do not access data with this function inside inner loops, it's slow. 794 Get raw data buffer with L{Brick.get_data_const}() and access it 795 directly instead. 796 797 @since: 2.31 798 799 @param x: Position in the brick (x direction). I{(float)} 800 @param y: Position in the brick (y direction). I{(float)} 801 @param z: Position in the brick (z direction). I{(float)} 802 @param value: Value to be set. I{(float)} 803 """ 804 pass
805
806 - def get_dval(x, y, z, interpolation):
807 """ 808 Gets interpolated value at arbitrary data brick point indexed by pixel 809 coordinates. 810 811 Note pixel values are centered in intervals [B{C{i}}, B{C{i}}+1]. 812 See also L{Brick.get_dval_real}() that does the same, but takes 813 real coordinates. 814 815 @since: 2.31 816 817 @param x: Position in data brick in range [0, x resolution]. If the value is outside 818 this range, the nearest border value is returned. I{(float)} 819 @param y: Position in data brick in range [0, y resolution]. If the value is outside 820 this range, the nearest border value is returned. I{(float)} 821 @param z: Position in data brick in range [0, z resolution]. If the value is outside 822 this range, the nearest border value is returned. I{(float)} 823 @param interpolation: Interpolation method to use. I{(int)} 824 @return: Value interpolated in the data brick. I{(float)} 825 """ 826 return None
827
828 - def get_dval_real(x, y, z, interpolation):
829 """ 830 Gets interpolated value at arbitrary data brick point indexed by pixel 831 coordinates. 832 833 Note pixel values are centered in intervals [B{C{j}}, B{C{j}}+1]. 834 See also L{Brick.get_dval}() that does the same, but takes 835 pixel coordinates. 836 837 @since: 2.31 838 839 @param x: Position in data brick in range [0, x resolution]. If the value is 840 outside this range, the nearest border value is returned. I{(float)} 841 @param y: Position in data brick in range [0, y resolution]. If the value is 842 outside this range, the nearest border value is returned. I{(float)} 843 @param z: Position in data brick in range [0, z resolution]. If the value is 844 outside this range, the nearest border value is returned. I{(float)} 845 @param interpolation: Interpolation method to use. I{(int)} 846 @return: Value interpolated in the data brick. I{(float)} 847 """ 848 return None
849
850 - def clear():
851 """ 852 Fills a data brick with zeroes. 853 854 @since: 2.31 855 856 """ 857 pass
858
859 - def fill(value):
860 """ 861 Fills a data brick with specified value. 862 863 @since: 2.31 864 865 @param value: Value to fill data brick with. I{(float)} 866 """ 867 pass
868
869 - def multiply(value):
870 """ 871 Multiplies all values in a data brick with a specified value. 872 873 @since: 2.31 874 875 @param value: Value to multiply data brick with. I{(float)} 876 """ 877 pass
878
879 - def add(value):
880 """ 881 Adds a specified value to all values in a data brick. 882 883 @since: 2.31 884 885 @param value: Value to be added. I{(float)} 886 """ 887 pass
888
889 - def extract_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
890 """ 891 Extract a plane (DataField) from the brick. 892 893 One value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, determining the 894 plane orientation. 895 896 @since: 2.31 897 898 @param target: Datafield to be filled by extracted plane. It will be resized if 899 necessary. I{(L{DataField})} 900 @param istart: Column where to start (pixel coordinates). I{(int)} 901 @param jstart: Row where to start (pixel coordinates). I{(int)} 902 @param kstart: Level where to start (pixel coordinates). I{(int)} 903 @param width: Pixel width of extracted plane. If B{C{width}} is -1, the yz plane will 904 be extracted. I{(int)} 905 @param height: Pixel height of extracted plane. If B{C{height}} is -1, the xz plane 906 will be extracted I{(int)} 907 @param depth: Pixel depth of extracted plane. If B{C{depth}} is -1, the xy plane will 908 be extracted I{(int)} 909 @param keep_offsets: Keep the physical offsets in extracted field. I{(bool)} 910 """ 911 pass
912
913 - def sum_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
914 """ 915 Sums planes in certain direction and extract the result (DataField). One 916 value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, determining the plane 917 orientation. In contrast to L{Brick.extract_plane}, the appropriate start 918 coordinate (e.g. B{C{istart}} if B{C{width}} = -1) is not used for single plane 919 extraction, but the planes are accumulated in whole range (0..xres for given 920 example) 921 922 @since: 2.31 923 924 @param target: Datafield to be filled by summed plane. It will be resized if 925 necessary. I{(L{DataField})} 926 @param istart: Column where to start (pixel coordinates). I{(int)} 927 @param jstart: Row where to start (pixel coordinates). I{(int)} 928 @param kstart: Level where to start (pixel coordinates). I{(int)} 929 @param width: Pixel width of summed plane. If B{C{width}} is -1, the yz planes will be 930 summed. I{(int)} 931 @param height: Pixel height of summed plane. If B{C{height}} is -1, the xz planes will 932 be summed I{(int)} 933 @param depth: Pixel depth of summed plane. If B{C{depth}} is -1, the xy planes will 934 be summed I{(int)} 935 @param keep_offsets: Keep the physical offsets in extracted field. Not 936 implemented. I{(bool)} 937 """ 938 pass
939
940 - def min_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
941 """ 942 Finds minima of planes in certain direction and extract the result 943 (DataField). One value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, 944 determining the plane orientation. In contrast to L{Brick.extract_plane}, 945 the appropriate start coordinate (e.g. B{C{istart}} if B{C{width}} = -1) is not used 946 for single plane extraction, but the planes are accumulated in whole range 947 (0..xres for given example) 948 949 @since: 2.32 950 951 @param target: Datafield to be filled by the minima plane. It will be resized if 952 necessary. I{(L{DataField})} 953 @param istart: Column where to start (pixel coordinates). I{(int)} 954 @param jstart: Row where to start (pixel coordinates). I{(int)} 955 @param kstart: Level where to start (pixel coordinates). I{(int)} 956 @param width: Pixel width of summarized plane. If B{C{width}} is -1, the yz planes will 957 be summarized. I{(int)} 958 @param height: Pixel height of summarized plane. If B{C{height}} is -1, the xz planes 959 will be summarized. I{(int)} 960 @param depth: Pixel depth of summarized plane. If B{C{depth}} is -1, the xy planes will 961 be summarized I{(int)} 962 @param keep_offsets: Keep the physical offsets in extracted field. Not 963 implemented. I{(bool)} 964 """ 965 pass
966
967 - def max_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
968 """ 969 Finds minima of planes in certain direction and extract the result 970 (DataField). One value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, 971 determining the plane orientation. In contrast to L{Brick.extract_plane}, 972 the appropriate start coordinate (e.g. B{C{istart}} if B{C{width}} = -1) is not used 973 for single plane extraction, but the planes are accumulated in whole range 974 (0..xres for given example) 975 976 @since: 2.32 977 978 @param target: Datafield to be filled by the maxima plane. It will be resized if 979 necessary. I{(L{DataField})} 980 @param istart: Column where to start (pixel coordinates). I{(int)} 981 @param jstart: Row where to start (pixel coordinates). I{(int)} 982 @param kstart: Level where to start (pixel coordinates). I{(int)} 983 @param width: Pixel width of summarized plane. If B{C{width}} is -1, the yz planes will 984 be summarized. I{(int)} 985 @param height: Pixel height of summarized plane. If B{C{height}} is -1, the xz planes 986 will be summarized. I{(int)} 987 @param depth: Pixel depth of extracted plane. If B{C{depth}} is -1, the xy planes will 988 be summarized I{(int)} 989 @param keep_offsets: Keep the physical offsets in extracted field. Not 990 implemented. I{(bool)} 991 """ 992 pass
993
994 - def minpos_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
995 """ 996 Finds minima positions of planes in certain direction and extract the result 997 (DataField). One value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, 998 determining the plane orientation. In contrast to L{Brick.extract_plane}, 999 the appropriate start coordinate (e.g. B{C{istart}} if B{C{width}} = -1) is not used 1000 for single plane extraction, but the planes are accumulated in whole range 1001 (0..xres for given example) 1002 1003 @since: 2.32 1004 1005 @param target: Datafield to be filled by the minima positions plane. 1006 It will be resized if necessary. I{(L{DataField})} 1007 @param istart: Column where to start (pixel coordinates). I{(int)} 1008 @param jstart: Row where to start (pixel coordinates). I{(int)} 1009 @param kstart: Level where to start (pixel coordinates). I{(int)} 1010 @param width: Pixel width of summarized plane. If B{C{width}} is -1, the yz planes will 1011 be summarized. I{(int)} 1012 @param height: Pixel height of summarized plane. If B{C{height}} is -1, the xz planes 1013 will be summarized. I{(int)} 1014 @param depth: Pixel depth of summarized plane. If B{C{depth}} is -1, the xy planes will 1015 be summarized I{(int)} 1016 @param keep_offsets: Keep the physical offsets in summarized field. Not 1017 implemented. I{(bool)} 1018 """ 1019 pass
1020
1021 - def maxpos_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
1022 """ 1023 Finds maxima positions of planes in certain direction and extract the result 1024 (DataField). One value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, 1025 determining the plane orientation. In contrast to L{Brick.extract_plane}, 1026 the appropriate start coordinate (e.g. B{C{istart}} if B{C{width}} = -1) is not used 1027 for single plane extraction, but the planes are accumulated in whole range 1028 (0..xres for given example) 1029 1030 @since: 2.32 1031 1032 @param target: Datafield to be filled by the maxima positions plane. 1033 It will be resized if necessary. I{(L{DataField})} 1034 @param istart: Column where to start (pixel coordinates). I{(int)} 1035 @param jstart: Row where to start (pixel coordinates). I{(int)} 1036 @param kstart: Level where to start (pixel coordinates). I{(int)} 1037 @param width: Pixel width of summarized plane. If B{C{width}} is -1, the yz planes will 1038 be summarized. I{(int)} 1039 @param height: Pixel height of summarized plane. If B{C{height}} is -1, the xz planes 1040 will be summarized I{(int)} 1041 @param depth: Pixel depth of summarized plane. If B{C{depth}} is -1, the xy planes will 1042 be summarized I{(int)} 1043 @param keep_offsets: Keep the physical offsets in summarized field. Not 1044 implemented. I{(bool)} 1045 """ 1046 pass
1047
1048 - def mean_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
1049 """ 1050 Finds mean of planes in certain direction and extract the result 1051 (DataField). One value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, 1052 determining the plane orientation. In contrast to L{Brick.extract_plane}, 1053 the appropriate start coordinate (e.g. B{C{istart}} if B{C{width}} = -1) is not used 1054 for single plane extraction, but the planes are accumulated in whole range 1055 (0..xres for given example) 1056 1057 @since: 2.32 1058 1059 @param target: Datafield to be filled by the mean plane. It will be resized if 1060 necessary. I{(L{DataField})} 1061 @param istart: Column where to start (pixel coordinates). I{(int)} 1062 @param jstart: Row where to start (pixel coordinates). I{(int)} 1063 @param kstart: Level where to start (pixel coordinates). I{(int)} 1064 @param width: Pixel width of summarized plane. If B{C{width}} is -1, the yz planes will 1065 be summarized. I{(int)} 1066 @param height: Pixel height of summarized plane. If B{C{height}} is -1, the xz planes 1067 will be summarized. I{(int)} 1068 @param depth: Pixel depth of summarized plane. If B{C{depth}} is -1, the xy planes will 1069 be summarized. I{(int)} 1070 @param keep_offsets: Keep the physical offsets in summarized field. Not 1071 implemented. I{(bool)} 1072 """ 1073 pass
1074
1075 - def rms_plane(target, istart, jstart, kstart, width, height, depth, keep_offsets):
1076 """ 1077 Finds rms of planes in certain direction and extract the result 1078 (DataField). One value of set (B{C{width}}, B{C{height}}, B{C{depth}}) needs to be -1, 1079 determining the plane orientation. In contrast to L{Brick.extract_plane}, 1080 the appropriate start coordinate (e.g. B{C{istart}} if B{C{width}} = -1) is not used 1081 for single plane extraction, but the planes are accumulated in whole range 1082 (0..xres for given example) 1083 1084 @since: 2.32 1085 1086 @param target: Datafield to be filled by the rms plane. It will be resized if 1087 necessary. I{(L{DataField})} 1088 @param istart: Column where to start (pixel coordinates). I{(int)} 1089 @param jstart: Row where to start (pixel coordinates). I{(int)} 1090 @param kstart: Level where to start (pixel coordinates). I{(int)} 1091 @param width: Pixel width of summarized plane. If B{C{width}} is -1, the yz planes will 1092 be summarized. I{(int)} 1093 @param height: Pixel height of summarized plane. If B{C{height}} is -1, the xz planes 1094 will be summarized. I{(int)} 1095 @param depth: Pixel depth of summarized plane. If B{C{depth}} is -1, the xy planes will 1096 be summarized. I{(int)} 1097 @param keep_offsets: Keep the physical offsets in extracted field. Not 1098 implemented. I{(bool)} 1099 """ 1100 pass
1101
1102 - def extract_line(target, istart, jstart, kstart, iend, jend, kend, keep_offsets):
1103 """ 1104 Extract a line (DataLine) from the brick. 1105 1106 Only line orientations parallel to coordinate axes are supported now, i.e. 1107 two of the start coordinates need to be same as end ones. 1108 1109 @since: 2.31 1110 1111 @param target: Dataline to be filled by extracted line. It will be resized if 1112 necessary. I{(L{DataLine})} 1113 @param istart: Column where to start (pixel coordinates). I{(int)} 1114 @param jstart: Row where to start (pixel coordinates). I{(int)} 1115 @param kstart: Level where to start (pixel coordinates). I{(int)} 1116 @param iend: Column where to start (pixel coordinates). I{(int)} 1117 @param jend: Row where to start (pixel coordinates). I{(int)} 1118 @param kend: Level where to start (pixel coordinates). I{(int)} 1119 @param keep_offsets: Keep physical offsets in extracted line. I{(bool)} 1120 """ 1121 pass
1122
1123 - def get_zcalibration():
1124 """ 1125 Gets the z-axis non-linear calibration of a data brick. 1126 1127 @since: 2.32 1128 1129 @return: Z Calibration (non-linear Z-axis values as ordinates). I{(L{DataLine})} 1130 """ 1131 return None
1132
1133 - def set_zcalibration(calibration):
1134 """ 1135 Sets the z-axis non-linear calibration of a data brick. 1136 1137 @since: 2.32 1138 1139 @param calibration: DataLine pointer with z-axis non-linear calibration 1140 of a data brick (values are stored as ordinates). It can also 1141 be B{C{None}} to unset the calibration. I{(L{DataLine})} 1142 """ 1143 pass
1144
1145 - def get_data():
1146 """ 1147 Extract the data of a data brick. 1148 1149 The returned list contains a copy of the data. Changing its contents does 1150 not change the data brick's data. 1151 1152 1153 @return: List containing extracted data brick data. I{(list)} 1154 """ 1155 return None
1156
1157 - def set_data(data):
1158 """ 1159 Sets the entire contents of a data brick. 1160 1161 The length of B{C{data}} must be equal to the number of elements of the data 1162 brick. 1163 1164 @param data: Sequence of floating point values. I{(list)} 1165 """ 1166 pass
1167
1168 - def duplicate():
1169 """ 1170 Convenience macro doing L{gwy_serializable_duplicate}() with all the necessary 1171 typecasting. 1172 1173 @since: 2.31 1174 1175 @return: I{(L{Brick})} 1176 """ 1177 return None
1178
1179 - def get_data_pointer():
1180 """ 1181 Gets pointer to data which the brick contains. 1182 1183 1184 @return: integer pointing to the raw data of the brick I{(long)} 1185 """ 1186 return None
1187 1188
1189 -class ColorAxis:
1190 - def __init__(orientation):
1191 """ 1192 Creates a new color axis. 1193 1194 1195 @param orientation: The orientation of the axis. I{(GtkOrientation)} 1196 @return: The newly created color axis as a B{C{GtkWidget}}. I{(L{gtk.Widget})} 1197 """ 1198 return None
1199
1200 - def get_range():
1201 """ 1202 Gets the range of a color axis. 1203 1204 @return: Tuple consisting of 2 values (B{C{min}}, B{C{max}}). (I{(float)}, I{(float)}) 1205 """ 1206 return None, None
1207
1208 - def set_range(min, max):
1209 """ 1210 Sets the range of a color axis. 1211 1212 @param min: The range minimum. I{(float)} 1213 @param max: The range maximum. I{(float)} 1214 """ 1215 pass
1216
1217 - def get_si_unit():
1218 """ 1219 Gets the SI unit a color axis displays. 1220 1221 1222 @return: The SI unit. I{(L{SIUnit})} 1223 """ 1224 return None
1225
1226 - def set_si_unit(unit):
1227 """ 1228 Sets the SI unit a color axis displays. 1229 1230 @param unit: A SI unit to display next to minimum and maximum value. I{(L{SIUnit})} 1231 """ 1232 pass
1233
1234 - def set_gradient(gradient):
1235 """ 1236 Sets the color gradient a color axis should use. 1237 1238 @param gradient: Name of gradient B{C{axis}} should use. It should exist. I{(string)} 1239 """ 1240 pass
1241
1242 - def get_gradient():
1243 """ 1244 Gets the color gradient a color axis uses. 1245 1246 1247 @return: The color gradient. I{(string)} 1248 """ 1249 return None
1250
1251 - def get_ticks_style():
1252 """ 1253 Gets ticks style of a color axis. 1254 1255 1256 @return: The ticks style. I{(TicksStyle)} 1257 """ 1258 return None
1259
1260 - def set_ticks_style(ticks_style):
1261 """ 1262 Sets the ticks style of a color axis. 1263 1264 @param ticks_style: The ticks style to use. Expected values: C{B{TICKS_STYLE_NONE}}, C{B{TICKS_STYLE_CENTER}}, C{B{TICKS_STYLE_AUTO}}, C{B{TICKS_STYLE_UNLABELED}}, C{B{TICKS_STYLE_UNLABELLED}}. I{(L{TicksStyle})} 1265 """ 1266 pass
1267
1268 - def get_labels_visible():
1269 """ 1270 Gets the visibility of labels of a color axis. 1271 1272 1273 @return: B{C{True}} if labels are displayed, B{C{False}} if they are omitted. I{(bool)} 1274 """ 1275 return None
1276
1277 - def set_labels_visible(labels_visible):
1278 """ 1279 Sets the visibility of labels of a color axis. 1280 1281 @param labels_visible: B{C{True}} to display labels with minimum and maximum values, 1282 B{C{False}} to display no labels. I{(bool)} 1283 """ 1284 pass
1285 1286
1287 -class ColorButton:
1288 - def __init__():
1289 """ 1290 Creates a new color button. This returns a widget in the form of 1291 a small button containing a swatch representing the current selected 1292 color. When the button is clicked, a color-selection dialog will open, 1293 allowing the user to select a color. The swatch will be updated to reflect 1294 the new color when the user finishes. 1295 1296 1297 @return: a new color button. I{(L{gtk.Widget})} 1298 """ 1299 return None
1300
1301 - def set_color(color):
1302 """ 1303 Sets the current color to be B{C{color}}. 1304 1305 @param color: A B{C{RGBA}} to set the current color with. I{(const-RGBA*)} 1306 """ 1307 pass
1308
1309 - def get_color():
1310 """ 1311 Sets B{C{color}} to be the current color in the B{C{ColorButton}} widget. 1312 1313 @return: Value B{C{color}}. (I{(RGBAOutArg)}) 1314 """ 1315 return None
1316
1317 - def set_use_alpha(use_alpha):
1318 """ 1319 Sets whether or not the color button should use the alpha channel. 1320 1321 @param use_alpha: B{C{True}} if color button should use alpha channel, B{C{False}} if not. I{(bool)} 1322 """ 1323 pass
1324
1325 - def get_use_alpha():
1326 """ 1327 Does the color selection dialog use the alpha channel? 1328 1329 1330 @return: B{C{True}} if the color sample uses alpha channel, B{C{False}} if not. I{(bool)} 1331 """ 1332 return None
1333 1334
1335 -class Container:
1336 """ 1337 A container with items identified by a GQuark 1338 1339 1340 B{C{Container}} is a general-purpose container, it can hold atomic types, 1341 strings and objects. However, objects must implement the B{C{Serializable}} 1342 interface, because the container itself is serializable. 1343 1344 A new container can be created with L{Container.new}(), items can be stored 1345 with function like L{Container.set_double}(), read with 1346 L{Container.get_double}(), and removed with L{Container.remove}() or 1347 L{Container.remove_by_prefix}(). A presence of a value can be tested with 1348 L{Container.contains}(), convenience functions for reading (updating) a 1349 value only if it is present like L{Container.gis_double}(), are available 1350 too. 1351 1352 B{C{Container}} takes ownership of stored non-atomic items. For strings, this 1353 means you cannot store static strings (use g_strdup() to duplicate them), 1354 and must not free stored dynamic strings, as the container will free them 1355 itself when they are removed or when the container is finalized. For 1356 objects, this means it takes a reference on the object (released when the 1357 object is removed or the container is finalized), so you usually want to 1358 g_object_unref() objects after storing them to a container. 1359 1360 Items in a B{C{Container}} can be identified by a B{C{GQuark}} or the corresponding 1361 string. While B{C{GQuark}}'s are atomic values and allow faster acces, they are 1362 less convenient for casual usage -- each B{C{GQuark}} key function like 1363 L{Container.set_double}() thus has a string-key counterpart 1364 L{Container.set_double_by_name}(). 1365 1366 """
1367 - def __init__():
1368 """ 1369 Creates a new B{C{Container}}. 1370 1371 1372 @return: The container, as a B{C{GObject}}. I{(L{Container})} 1373 """ 1374 return None
1375
1376 - def get_n_items():
1377 """ 1378 Gets the number of items in a container. 1379 1380 1381 @return: The number of items. I{(int)} 1382 """ 1383 return None
1384
1385 - def value_type(key):
1386 """ 1387 Returns the type of value in B{C{container}} identified by B{C{key}}. 1388 1389 1390 @param key: A B{C{GQuark}} key. I{(int)} 1391 @return: The value type as B{C{GType}}; 0 if there is no such value. I{(GType)} 1392 """ 1393 return None
1394
1395 - def contains(key):
1396 """ 1397 Returns B{C{True}} if B{C{container}} contains a value identified by B{C{key}}. 1398 1399 1400 @param key: A B{C{GQuark}} key. I{(int)} 1401 @return: Whether B{C{container}} contains something identified by B{C{key}}. I{(bool)} 1402 """ 1403 return None
1404
1405 - def remove(key):
1406 """ 1407 Removes a value identified by B{C{key}} from a container. 1408 1409 1410 @param key: A B{C{GQuark}} key. I{(int)} 1411 @return: B{C{True}} if there was such a value and was removed. I{(bool)} 1412 """ 1413 return None
1414
1415 - def remove_by_prefix(prefix):
1416 """ 1417 Removes a values whose key start with B{C{prefix}} from container B{C{container}}. 1418 1419 B{C{prefix}} can be B{C{None}}, all values are then removed. 1420 1421 1422 @param prefix: A nul-terminated id prefix. I{(string)} 1423 @return: The number of values removed. I{(int)} 1424 """ 1425 return None
1426
1427 - def transfer(dest, source_prefix, dest_prefix, force):
1428 """ 1429 Copies a items from one place in container to another place. 1430 1431 The copies are shallow, objects are not physically duplicated, only 1432 referenced in B{C{dest}}. 1433 1434 1435 @param dest: Destination container. It may be the same container as B{C{source}}, but 1436 B{C{source_prefix}} and B{C{dest_prefix}} may not overlap then. I{(L{Container})} 1437 @param source_prefix: Prefix in B{C{source}} to take values from. I{(string)} 1438 @param dest_prefix: Prefix in B{C{dest}} to put values to. I{(string)} 1439 @param force: B{C{True}} to replace existing values in B{C{dest}}. I{(bool)} 1440 @return: The number of actually transferred items. I{(int)} 1441 """ 1442 return None
1443
1444 - def rename(key, newkey, force):
1445 """ 1446 Makes a value in B{C{container}} identified by B{C{key}} to be identified by B{C{newkey}}. 1447 1448 When B{C{force}} is B{C{True}} existing value at B{C{newkey}} is removed from B{C{container}}. 1449 When it's B{C{False}}, an existing value B{C{newkey}} inhibits the rename and B{C{False}} 1450 is returned. 1451 1452 1453 @param key: The current key. I{(int)} 1454 @param newkey: A new key for the value. I{(int)} 1455 @param force: Whether to replace existing value at B{C{newkey}}. I{(bool)} 1456 @return: Whether the rename succeeded. I{(bool)} 1457 """ 1458 return None
1459
1460 - def foreach(prefix, function, user_data):
1461 """ 1462 Calls B{C{function}} on each B{C{container}} item whose identifier starts with 1463 B{C{prefix}}. 1464 1465 The function is called B{C{function}}(B{C{GQuark}} key, B{C{GValue}} *value, user_data). 1466 1467 1468 @param prefix: A nul-terminated id prefix. I{(string)} 1469 @param function: The function called on the items. I{(GHFunc)} 1470 @param user_data: The user data passed to B{C{function}}. I{(gpointer)} 1471 @return: The number of items B{C{function}} was called on. I{(int)} 1472 """ 1473 return None
1474
1475 - def set_boolean(key, value):
1476 """ 1477 Stores a boolean into B{C{container}}, identified by B{C{key}}. 1478 1479 @param key: A B{C{GQuark}} key. I{(int)} 1480 @param value: A boolean. I{(bool)} 1481 """ 1482 pass
1483
1484 - def get_boolean(key):
1485 """ 1486 Returns the boolean in B{C{container}} identified by B{C{key}}. 1487 1488 1489 @param key: A B{C{GQuark}} key. I{(int)} 1490 @return: The boolean as B{C{gboolean}}. I{(bool)} 1491 """ 1492 return None
1493
1494 - def set_uchar(key, value):
1495 """ 1496 Stores an unsigned character into B{C{container}}, identified by B{C{key}}. 1497 1498 @param key: A B{C{GQuark}} key. I{(int)} 1499 @param value: An unsigned character. I{(guchar)} 1500 """ 1501 pass
1502
1503 - def get_uchar(key):
1504 """ 1505 Returns the unsigned character in B{C{container}} identified by B{C{key}}. 1506 1507 1508 @param key: A B{C{GQuark}} key. I{(int)} 1509 @return: The character as B{C{guchar}}. I{(guchar)} 1510 """ 1511 return None
1512
1513 - def set_int32(key, value):
1514 """ 1515 Stores a 32bit integer into B{C{container}}, identified by B{C{key}}. 1516 1517 @param key: A B{C{GQuark}} key. I{(int)} 1518 @param value: A 32bit integer. I{(int)} 1519 """ 1520 pass
1521
1522 - def get_int32(key):
1523 """ 1524 Returns the 32bit integer in B{C{container}} identified by B{C{key}}. 1525 1526 1527 @param key: A B{C{GQuark}} key. I{(int)} 1528 @return: The integer as B{C{guint32}}. I{(int)} 1529 """ 1530 return None
1531
1532 - def set_enum(key, value):
1533 """ 1534 Stores an enum into B{C{container}}, identified by B{C{key}}. 1535 1536 Note enums are treated as 32bit integers. 1537 1538 @param key: A B{C{GQuark}} key. I{(int)} 1539 @param value: An enum integer. I{(int)} 1540 """ 1541 pass
1542
1543 - def get_enum(key):
1544 """ 1545 Returns the enum in B{C{container}} identified by B{C{key}}. 1546 1547 Note enums are treated as 32bit integers. 1548 1549 1550 @param key: A B{C{GQuark}} key. I{(int)} 1551 @return: The enum as B{C{gint}}. I{(int)} 1552 """ 1553 return None
1554
1555 - def set_int64(key, value):
1556 """ 1557 Stores a 64bit integer into B{C{container}}, identified by B{C{key}}. 1558 1559 @param key: A B{C{GQuark}} key. I{(int)} 1560 @param value: A 64bit integer. I{(gint64)} 1561 """ 1562 pass
1563
1564 - def get_int64(key):
1565 """ 1566 Returns the 64bit integer in B{C{container}} identified by B{C{key}}. 1567 1568 1569 @param key: A B{C{GQuark}} key. I{(int)} 1570 @return: The 64bit integer as B{C{guint64}}. I{(gint64)} 1571 """ 1572 return None
1573
1574 - def set_double(key, value):
1575 """ 1576 Stores a double into B{C{container}}, identified by B{C{key}}. 1577 1578 @param key: A B{C{GQuark}} key. I{(int)} 1579 @param value: A double. I{(float)} 1580 """ 1581 pass
1582
1583 - def get_double(key):
1584 """ 1585 Returns the double in B{C{container}} identified by B{C{key}}. 1586 1587 1588 @param key: A B{C{GQuark}} key. I{(int)} 1589 @return: The double as B{C{gdouble}}. I{(float)} 1590 """ 1591 return None
1592
1593 - def get_string(key):
1594 """ 1595 Returns the string in B{C{container}} identified by B{C{key}}. 1596 1597 The returned string must be treated as constant and never freed or modified. 1598 1599 1600 @param key: A B{C{GQuark}} key. I{(int)} 1601 @return: The string. I{(string)} 1602 """ 1603 return None
1604
1605 - def set_object(key, value):
1606 """ 1607 Stores an object into B{C{container}}, identified by B{C{key}}. 1608 1609 The container claims ownership on the object, i.e. its reference count is 1610 incremented. 1611 1612 The object must implement B{C{Serializable}} interface to allow serialization 1613 of the container. 1614 1615 @param key: A B{C{GQuark}} key. I{(int)} 1616 @param value: An object to store into container. I{(L{gobject.GObject})} 1617 """ 1618 pass
1619
1620 - def get_object(key):
1621 """ 1622 Returns the object in B{C{container}} identified by B{C{key}}. 1623 1624 The returned object doesn't have its reference count increased, use 1625 g_object_ref() if you want to access it even when B{C{container}} may cease 1626 to exist. 1627 1628 1629 @param key: A B{C{GQuark}} key. I{(int)} 1630 @return: The object as B{C{gpointer}}. I{(L{gobject.GObject})} 1631 """ 1632 return None
1633
1634 - def keys():
1635 """ 1636 Gets all quark keys of a container. 1637 1638 @since: 2.7 1639 1640 @return: A newly allocated array with quark keys of all B{C{container}} items, 1641 in no particular order. The number of items can be obtained 1642 with L{Container.get_n_items}(). If there are no items, B{C{None}} 1643 is returned. I{(list)} 1644 """ 1645 return None
1646
1647 - def keys_by_name():
1648 """ 1649 Gets all string keys of a container. 1650 1651 @since: 2.7 1652 1653 @return: A newly allocated array with string keys of all B{C{container}} items, 1654 in no particular order. The number of items can be obtained 1655 with L{Container.get_n_items}(). If there are no items, B{C{None}} 1656 is returned. Unlike the array the strings are owned by GLib and 1657 must not be freed. I{(ConstStringArray*)} 1658 """ 1659 return None
1660
1661 - def duplicate_by_prefix(keys):
1662 """ 1663 Duplicates a container keeping only values under given prefixes. 1664 1665 Like L{Container.duplicate}(), this method creates a deep copy, that is 1666 contained object are physically duplicated too, not just referenced again. 1667 1668 1669 @param keys: I{(StringArray*)} 1670 @return: A newly created container. I{(L{Container})} 1671 """ 1672 return None
1673
1674 - def serialize_to_text():
1675 """ 1676 Creates a text representation of B{C{container}} contents. 1677 1678 Note only simple data types are supported as serialization of compound 1679 objects is not controllable. 1680 1681 1682 @return: A pointer array, each item containing string with one container 1683 item representation (name, type, value). The array is sorted by name. I{(StringArray*)} 1684 """ 1685 return None
1686
1687 - def contains_by_name(n):
1688 """ 1689 Expands to B{C{True}} if container B{C{c}} contains a value identified by name B{C{n}}. 1690 1691 @param n: A nul-terminated name (id). I{(string)} 1692 @return: I{(bool)} 1693 """ 1694 return None
1695
1696 - def remove_by_name(n):
1697 """ 1698 Removes a value identified by name B{C{n}} from container B{C{c}}. 1699 1700 Expands to B{C{True}} if there was such a value and was removed. 1701 1702 @param n: A nul-terminated name (id). I{(string)} 1703 @return: I{(bool)} 1704 """ 1705 return None
1706
1707 - def rename_by_name(n, new_name, force):
1708 """ 1709 Makes a value in container B{C{c}} identified by name B{C{n}} to be identified by 1710 new name B{C{nn}}. 1711 1712 See L{Container.rename}() for details. 1713 1714 @param n: A nul-terminated name (id). I{(string)} 1715 @param new_name: I{(string)} 1716 @param force: I{(bool)} 1717 @return: I{(bool)} 1718 """ 1719 return None
1720
1721 - def set_boolean_by_name(n, v):
1722 """ 1723 Stores a boolean into container B{C{c}}, identified by name B{C{n}}. 1724 1725 @param n: A nul-terminated name (id). I{(string)} 1726 @param v: A boolean. I{(bool)} 1727 """ 1728 pass
1729
1730 - def set_double_by_name(n, v):
1731 """ 1732 Stores a double into container B{C{c}}, identified by name B{C{n}}. 1733 1734 @param n: A nul-terminated name (id). I{(string)} 1735 @param v: A double integer. I{(float)} 1736 """ 1737 pass
1738
1739 - def set_enum_by_name(n, v):
1740 """ 1741 Stores an enum into container B{C{c}}, identified by name B{C{n}}. 1742 1743 Note enums are treated as 32bit integers. 1744 1745 @param n: A nul-terminated name (id). I{(string)} 1746 @param v: An enum. I{(int)} 1747 """ 1748 pass
1749
1750 - def set_int32_by_name(n, v):
1751 """ 1752 Stores a 32bit integer into container B{C{c}}, identified by name B{C{n}}. 1753 1754 @param n: A nul-terminated name (id). I{(string)} 1755 @param v: A 32bit integer. I{(int)} 1756 """ 1757 pass
1758
1759 - def set_int64_by_name(n, v):
1760 """ 1761 Stores a 64bit integer into container B{C{c}}, identified by name B{C{n}}. 1762 1763 @param n: A nul-terminated name (id). I{(string)} 1764 @param v: A 64bit integer. I{(gint64)} 1765 """ 1766 pass
1767
1768 - def set_object_by_name(n, v):
1769 """ 1770 Stores an object into container B{C{c}}, identified by name B{C{n}}. 1771 1772 See L{Container.set_object}() for details. 1773 1774 @param n: A nul-terminated name (id). I{(string)} 1775 @param v: An object to store into container. I{(L{gobject.GObject})} 1776 """ 1777 pass
1778
1779 - def set_uchar_by_name(n, v):
1780 """ 1781 Stores an unsigned character into container B{C{c}}, identified by name B{C{n}}. 1782 1783 @param n: A nul-terminated name (id). I{(string)} 1784 @param v: An unsigned character. I{(guchar)} 1785 """ 1786 pass
1787
1788 - def get_boolean_by_name(n):
1789 """ 1790 Gets the boolean in container B{C{c}} identified by name B{C{n}}. 1791 1792 @param n: A nul-terminated name (id). I{(string)} 1793 @return: I{(bool)} 1794 """ 1795 return None
1796
1797 - def get_double_by_name(n):
1798 """ 1799 Gets the double in container B{C{c}} identified by name B{C{n}}. 1800 1801 @param n: A nul-terminated name (id). I{(string)} 1802 @return: I{(float)} 1803 """ 1804 return None
1805
1806 - def get_enum_by_name(n):
1807 """ 1808 Gets the enum in container B{C{c}} identified by name B{C{n}}. 1809 1810 Note enums are treated as 32bit integers. 1811 1812 @param n: A nul-terminated name (id). I{(string)} 1813 @return: I{(int)} 1814 """ 1815 return None
1816
1817 - def get_int32_by_name(n):
1818 """ 1819 Gets the 32bit integer in container B{C{c}} identified by name B{C{n}}. 1820 1821 @param n: A nul-terminated name (id). I{(string)} 1822 @return: I{(int)} 1823 """ 1824 return None
1825
1826 - def get_int64_by_name(n):
1827 """ 1828 Gets the 64bit integer in container B{C{c}} identified by name B{C{n}}. 1829 1830 @param n: A nul-terminated name (id). I{(string)} 1831 @return: I{(gint64)} 1832 """ 1833 return None
1834
1835 - def get_uchar_by_name(n):
1836 """ 1837 Gets the unsigned character in container B{C{c}} identified by name B{C{n}}. 1838 1839 @param n: A nul-terminated name (id). I{(string)} 1840 @return: I{(guchar)} 1841 """ 1842 return None
1843
1844 - def get_object_by_name(n):
1845 """ 1846 Gets the object in container B{C{c}} identified by name B{C{n}}. 1847 1848 The returned object doesn't have its reference count increased, use 1849 g_object_ref() if you want to access it even when B{C{container}} may cease 1850 to exist. 1851 1852 @param n: A nul-terminated name (id). I{(string)} 1853 @return: I{(L{gobject.GObject})} 1854 """ 1855 return None
1856
1857 - def get_string_by_name(n):
1858 """ 1859 Gets the string in container B{C{c}} identified by name B{C{n}}. 1860 1861 The returned string must be treated as constant and never freed or modified. 1862 1863 @param n: A nul-terminated name (id). I{(string)} 1864 @return: I{(string)} 1865 """ 1866 return None
1867
1868 - def duplicate():
1869 """ 1870 Convenience macro doing L{gwy_serializable_duplicate}() with all the necessary 1871 typecasting. 1872 1873 @return: I{(L{Container})} 1874 """ 1875 return None
1876
1877 - def set_string_by_name(name, value):
1878 """ 1879 Stores a string into container B{C{c}}, identified by name B{C{n}}. 1880 1881 The container makes a copy of the string, so it can be used on static 1882 strings. 1883 1884 @since: 2.38 1885 1886 @param name: I{(string)} 1887 @param value: I{(string)} 1888 """ 1889 pass
1890
1891 - def set_string(key, value):
1892 """ 1893 Stores a string into B{C{container}}, identified by B{C{key}}. 1894 1895 The container makes a copy of the string, so it can be used on static 1896 strings. 1897 1898 @since: 2.38 1899 1900 @param key: A B{C{GQuark}} key. I{(int)} 1901 @param value: A nul-terminated string. I{(string)} 1902 """ 1903 pass
1904
1905 - def keys_by_name():
1906 """ 1907 Gets all string keys of a container. 1908 1909 @since: 2.7 1910 1911 @return: A newly allocated array with string keys of all B{C{container}} items, 1912 in no particular order. The number of items can be obtained 1913 with L{Container.get_n_items}(). If there are no items, B{C{None}} 1914 is returned. Unlike the array the strings are owned by GLib and 1915 must not be freed. I{(list)} 1916 """ 1917 return None
1918
1919 - def get_value_by_name(name):
1920 """ 1921 Gets the value in container B{C{c}} identified by name B{C{n}}. 1922 1923 @param name: I{(string)} 1924 @return: I{(any)} 1925 """ 1926 return None
1927
1928 - def get_value(key):
1929 """ 1930 Returns the value in B{C{container}} identified by B{C{key}}. 1931 1932 1933 @param key: A B{C{GQuark}} key. I{(int)} 1934 @return: The value as a B{C{GValue}}. I{(any)} 1935 """ 1936 return None
1937
1938 - def set_value_by_name(name, value):
1939 """ 1940 Inserts or updates several values in B{C{container}}. 1941 1942 @param name: I{(string)} 1943 @param value: I{(any)} 1944 """ 1945 pass
1946
1947 - def set_value(key, value):
1948 """ 1949 Inserts or updates several values in B{C{container}}. 1950 1951 @param key: I{(int)} 1952 @param value: I{(any)} 1953 """ 1954 pass
1955 1956
1957 -class Curve:
1958 - def __init__():
1959 """ 1960 Creates B{C{Curve}} widget. By default, the widget will have 3 curves. 1961 1962 1963 @return: new B{C{Curve}} widget. I{(L{gtk.Widget})} 1964 """ 1965 return None
1966
1967 - def reset():
1968 """ 1969 Removes all control points, resetting the curves to their initial state. 1970 1971 1972 """ 1973 pass
1974
1975 - def set_range(min_x, max_x, min_y, max_y):
1976 pass
1977
1978 - def set_curve_type(type):
1979 pass
1980
1981 - def set_channels(num_channels, colors):
1982 pass
1983 1984
1985 -class DataField:
1986 """ 1987 Two-dimensional data representation 1988 1989 1990 B{C{DataField}} is an object that is used for representation of all 1991 two-dimensional data matrices. Most of the basic data handling and 1992 processing functions in Gwyddion are declared here as they are connected 1993 with B{C{DataField}}. 1994 1995 """
1996 - def __init__(xres, yres, xreal, yreal, nullme):
1997 """ 1998 Creates a new data field. 1999 2000 2001 @param xres: X-resolution, i.e., the number of columns. I{(int)} 2002 @param yres: Y-resolution, i.e., the number of rows. I{(int)} 2003 @param xreal: Real horizontal physical dimension. I{(float)} 2004 @param yreal: Real vertical physical dimension. I{(float)} 2005 @param nullme: Whether the data field should be initialized to zeroes. If B{C{False}}, 2006 the data will not be initialized. I{(bool)} 2007 @return: A newly created data field. I{(L{DataField})} 2008 """ 2009 return None
2010
2011 - def sum_fields(operand1, operand2):
2012 """ 2013 Sums two data fields. 2014 2015 @param operand1: First data field operand. I{(L{DataField})} 2016 @param operand2: Second data field operand. I{(L{DataField})} 2017 """ 2018 pass
2019
2020 - def subtract_fields(operand1, operand2):
2021 """ 2022 Subtracts one data field from another. 2023 2024 @param operand1: First data field operand. I{(L{DataField})} 2025 @param operand2: Second data field operand. I{(L{DataField})} 2026 """ 2027 pass
2028
2029 - def divide_fields(operand1, operand2):
2030 """ 2031 Divides one data field with another. 2032 2033 @param operand1: First data field operand. I{(L{DataField})} 2034 @param operand2: Second data field operand. I{(L{DataField})} 2035 """ 2036 pass
2037
2038 - def multiply_fields(operand1, operand2):
2039 """ 2040 Multiplies two data fields. 2041 2042 @param operand1: First data field operand. I{(L{DataField})} 2043 @param operand2: Second data field operand. I{(L{DataField})} 2044 """ 2045 pass
2046
2047 - def min_of_fields(operand1, operand2):
2048 """ 2049 Finds point-wise maxima of two data fields. 2050 2051 @param operand1: First data field operand. I{(L{DataField})} 2052 @param operand2: Second data field operand. I{(L{DataField})} 2053 """ 2054 pass
2055
2056 - def max_of_fields(operand1, operand2):
2057 """ 2058 Finds point-wise minima of two data fields. 2059 2060 @param operand1: First data field operand. I{(L{DataField})} 2061 @param operand2: Second data field operand. I{(L{DataField})} 2062 """ 2063 pass
2064
2065 - def hypot_of_fields(operand1, operand2):
2066 """ 2067 Finds point-wise hypotenuse of two data fields. 2068 2069 @since: 2.31 2070 2071 @param operand1: First data field operand. I{(L{DataField})} 2072 @param operand2: Second data field operand. I{(L{DataField})} 2073 """ 2074 pass
2075
2076 - def check_compatibility(data_field2, check):
2077 """ 2078 Checks whether two data fields are compatible. 2079 2080 2081 @param data_field2: Another data field. I{(L{DataField})} 2082 @param check: The compatibility tests to perform. Expected values: C{B{DATA_COMPATIBILITY_RES}}, C{B{DATA_COMPATIBILITY_REAL}}, C{B{DATA_COMPATIBILITY_MEASURE}}, C{B{DATA_COMPATIBILITY_LATERAL}}, C{B{DATA_COMPATIBILITY_VALUE}}, C{B{DATA_COMPATIBILITY_ALL}}. I{(L{DataCompatibilityFlags})} 2083 @return: Zero if all tested properties are compatible. Flags corresponding 2084 to failed tests if data fields are not compatible. I{(DataCompatibilityFlags)} 2085 """ 2086 return None
2087
2088 - def extend(left, right, up, down, exterior, fill_value, keep_offsets):
2089 """ 2090 Creates a new data field by extending another data field using the specified 2091 method of exterior handling. 2092 2093 @since: 2.36 2094 2095 @param left: Number of pixels to extend to the left (towards lower column indices). I{(int)} 2096 @param right: Number of pixels to extend to the right (towards higher column 2097 indices). I{(int)} 2098 @param up: Number of pixels to extend up (towards lower row indices). I{(int)} 2099 @param down: Number of pixels to extend down (towards higher row indices). I{(int)} 2100 @param exterior: Exterior pixels handling. Expected values: C{B{EXTERIOR_UNDEFINED}}, C{B{EXTERIOR_BORDER_EXTEND}}, C{B{EXTERIOR_MIRROR_EXTEND}}, C{B{EXTERIOR_PERIODIC}}, C{B{EXTERIOR_FIXED_VALUE}}. I{(L{ExteriorType})} 2101 @param fill_value: The value to use with B{C{EXTERIOR_FIXED_VALUE}} exterior. I{(float)} 2102 @param keep_offsets: B{C{True}} to set the X and Y offsets of the new field 2103 using B{C{field}} offsets. B{C{False}} to set offsets 2104 of the new field to zeroes. I{(bool)} 2105 @return: A newly created data field. I{(L{DataField})} 2106 """ 2107 return None
2108
2109 - def laplace_solve(mask, grain_id, qprec):
2110 """ 2111 Replaces masked areas by the solution of Laplace equation. 2112 2113 The boundary conditions on mask boundaries are Dirichlet with values given 2114 by pixels on the outer boundary of the masked area. Boundary conditions at 2115 field edges are Neumann conditions ∂z/∂n=0 where n denotes the normal to the 2116 edge. If entire area of B{C{field}} is to be replaced the problem is 2117 underspecified; B{C{field}} will be filled with zeroes. 2118 2119 For the default value of B{C{qprec}} the the result should be good enough for any 2120 image processing purposes with the typical local error of order 10⁻⁵ for 2121 very large grains and possibly much smaller for small grains. You can lower 2122 B{C{qprec}} down to about 0.3 or even 0.2 if speed is crucial and some precision 2123 can be sacrificed. Below that the result just starts becoming somewhat 2124 worse for not much speed increase. Conversely, you may wish to increase 2125 B{C{qprec}} up to 3 or even 5 if accuracy is important and you can afford the 2126 increased computation time. 2127 2128 @since: 2.47 2129 2130 @param mask: A two-dimensional data field containing mask defining the areas to 2131 interpolate. I{(L{DataField})} 2132 @param grain_id: The id number of the grain to replace with the solution of 2133 Laplace equation, from 1 to B{C{ngrains}} (see 2134 L{DataField.grain_numbers}()). Passing 0 means to replace the 2135 entire empty space outside grains while passing a negative value 2136 means to replace the entire masked area. I{(int)} 2137 @param qprec: Speed-accuracy tuning parameter. Pass 1.0 for the default that is 2138 fast and sufficiently precise. I{(float)} 2139 """ 2140 pass
2141
2142 - def correct_laplace_iteration(mask_field, buffer_field, corrfactor):
2143 """ 2144 Performs one interation of Laplace data correction. 2145 2146 Tries to remove all the points in mask off the data by using 2147 iterative method similar to solving heat flux equation. 2148 2149 Use this function repeatedly until reasonable B{C{error}} is reached. 2150 2151 @warning:For almost all purposes this function was superseded by 2152 non-iteratie L{DataField.laplace_solve}() which is simultaneously much 2153 faster and more accurate. 2154 2155 @param mask_field: Mask of places to be corrected. I{(L{DataField})} 2156 @param buffer_field: Initialized to same size as mask and data. I{(L{DataField})} 2157 @param corrfactor: Correction factor within step. I{(float)} 2158 @return: Value B{C{error}}. (I{(float)}) 2159 """ 2160 return None
2161
2162 - def correct_average(mask_field):
2163 """ 2164 Fills data under mask with the average value. 2165 2166 This function simply puts average value of all the B{C{data_field}} values (both 2167 masked and unmasked) into points in B{C{data_field}} lying under points where 2168 B{C{mask_field}} values are nonzero. 2169 2170 In most cases you probably want to use 2171 L{DataField.correct_average_unmasked}() instead. 2172 2173 @param mask_field: Mask of places to be corrected. I{(L{DataField})} 2174 """ 2175 pass
2176
2177 - def correct_average_unmasked(mask_field):
2178 """ 2179 Fills data under mask with the average value of unmasked data. 2180 2181 This function calculates the average value of all unmasked pixels in 2182 B{C{data_field}} and then fills all the masked pixels with this average value. 2183 It is useful as the first rough step of correction of data under the mask. 2184 2185 If all data are masked the field is filled with zeroes. 2186 2187 @since: 2.44 2188 2189 @param mask_field: Mask of places to be corrected. I{(L{DataField})} 2190 """ 2191 pass
2192
2193 - def mask_outliers(mask_field, thresh):
2194 """ 2195 Creates mask of data that are above or below B{C{thresh}}*sigma from average 2196 height. 2197 2198 Sigma denotes root-mean square deviation of heights. This criterium 2199 corresponds to the usual Gaussian distribution outliers detection if 2200 B{C{thresh}} is 3. 2201 2202 @param mask_field: A data field to be filled with mask. I{(L{DataField})} 2203 @param thresh: Threshold value. I{(float)} 2204 """ 2205 pass
2206
2207 - def mask_outliers2(mask_field, thresh_low, thresh_high):
2208 """ 2209 Creates mask of data that are above or below multiples of rms from average 2210 height. 2211 2212 Data that are below B{C{mean}}-B{C{thresh_low}}*B{C{sigma}} or above 2213 B{C{mean}}+B{C{thresh_high}}*B{C{sigma}} are marked as outliers, where B{C{sigma}} denotes the 2214 root-mean square deviation of heights. 2215 2216 @since: 2.26 2217 2218 @param mask_field: A data field to be filled with mask. I{(L{DataField})} 2219 @param thresh_low: Lower threshold value. I{(float)} 2220 @param thresh_high: Upper threshold value. I{(float)} 2221 """ 2222 pass
2223
2224 - def distort(dest, invtrans, user_data, interp, exterior, fill_value):
2225 """ 2226 Distorts a data field in the horizontal plane. 2227 2228 Note the transform function B{C{invtrans}} is the inverse transform, in other 2229 words it calculates the old coordinates from the new coordinates (the 2230 transform would not be uniquely defined the other way round). 2231 2232 @since: 2.5 2233 2234 @param dest: Destination data field. I{(L{DataField})} 2235 @param invtrans: Inverse transform function, that is the transformation from 2236 new coordinates to old coordinates. It gets 2237 (B{C{j}}+0.5, B{C{i}}+0.5), where B{C{i}} and B{C{j}} are the new row and column 2238 indices, passed as the input coordinates. The output coordinates 2239 should follow the same convention. Unless a special exterior 2240 handling is required, the transform function does not need to 2241 concern itself with coordinates being outside of the data. I{(CoordTransform2DFunc)} 2242 @param user_data: Pointer passed as B{C{user_data}} to B{C{invtrans}}. I{(gpointer)} 2243 @param interp: Interpolation type to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 2244 @param exterior: Exterior pixels handling. Expected values: C{B{EXTERIOR_UNDEFINED}}, C{B{EXTERIOR_BORDER_EXTEND}}, C{B{EXTERIOR_MIRROR_EXTEND}}, C{B{EXTERIOR_PERIODIC}}, C{B{EXTERIOR_FIXED_VALUE}}. I{(L{ExteriorType})} 2245 @param fill_value: The value to use with B{C{EXTERIOR_FIXED_VALUE}}. I{(float)} 2246 """ 2247 pass
2248
2249 - def sample_distorted(dest, coords, interp, exterior, fill_value):
2250 """ 2251 Resamples a data field in an arbitrarily distorted manner. 2252 2253 Each item in B{C{coords}} corresponds to one pixel in B{C{dest}} and gives the 2254 coordinates in B{C{source}} defining the value to set in this pixel. 2255 2256 @since: 2.45 2257 2258 @param dest: Destination data field. I{(L{DataField})} 2259 @param coords: Array of B{C{source}} coordinates with the same number of items as 2260 B{C{dest}}, ordered as data field data. 2261 See L{DataField.distort}() for coordinate convention discussion. I{(const-XY*)} 2262 @param interp: Interpolation type to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 2263 @param exterior: Exterior pixels handling. Expected values: C{B{EXTERIOR_UNDEFINED}}, C{B{EXTERIOR_BORDER_EXTEND}}, C{B{EXTERIOR_MIRROR_EXTEND}}, C{B{EXTERIOR_PERIODIC}}, C{B{EXTERIOR_FIXED_VALUE}}. I{(L{ExteriorType})} 2264 @param fill_value: The value to use with B{C{EXTERIOR_FIXED_VALUE}}. I{(float)} 2265 """ 2266 pass
2267
2268 - def mark_scars(result, threshold_high, threshold_low, min_scar_len, max_scar_width, negative):
2269 """ 2270 Find and marks scars in a data field. 2271 2272 Scars are linear horizontal defects, consisting of shifted values. 2273 Zero or negative values in B{C{result}} siginify normal data, positive 2274 values siginify samples that are part of a scar. 2275 2276 @since: 2.46 2277 2278 @param result: A data field to store the result to (it is resized to match 2279 B{C{data_field}}). I{(L{DataField})} 2280 @param threshold_high: Miminum relative step for scar marking, must be positive. I{(float)} 2281 @param threshold_low: Definite relative step for scar marking, must be at least 2282 equal to B{C{threshold_high}}. I{(float)} 2283 @param min_scar_len: Minimum length of a scar, shorter ones are discarded 2284 (must be at least one). I{(float)} 2285 @param max_scar_width: Maximum width of a scar, must be at least one. I{(float)} 2286 @param negative: B{C{True}} to detect negative scars, B{C{False}} to positive. I{(bool)} 2287 """ 2288 pass
2289
2290 - def get_correlation_score(kernel_field, col, row, kernel_col, kernel_row, kernel_width, kernel_height):
2291 """ 2292 Calculates a correlation score in one point. 2293 2294 Correlation window size is given 2295 by B{C{kernel_col}}, B{C{kernel_row}}, B{C{kernel_width}}, B{C{kernel_height}}, 2296 postion of the correlation window on data is given by 2297 B{C{col}}, B{C{row}}. 2298 2299 If anything fails (data too close to boundary, etc.), 2300 function returns -1.0 (none correlation).. 2301 2302 2303 @param kernel_field: Kernel to correlate data field with. I{(L{DataField})} 2304 @param col: Upper-left column position in the data field. I{(int)} 2305 @param row: Upper-left row position in the data field. I{(int)} 2306 @param kernel_col: Upper-left column position in kernel field. I{(int)} 2307 @param kernel_row: Upper-left row position in kernel field. I{(int)} 2308 @param kernel_width: Width of kernel field area. I{(int)} 2309 @param kernel_height: Heigh of kernel field area. I{(int)} 2310 @return: Correlation score (between -1.0 and 1.0). Value 1.0 denotes 2311 maximum correlation, -1.0 none correlation. I{(float)} 2312 """ 2313 return None
2314
2315 - def get_weighted_correlation_score(kernel_field, weight_field, col, row, kernel_col, kernel_row, kernel_width, kernel_height):
2316 """ 2317 Calculates a correlation score in one point using weights to center 2318 the used information to the center of kernel. 2319 2320 Correlation window size is given 2321 by B{C{kernel_col}}, B{C{kernel_row}}, B{C{kernel_width}}, B{C{kernel_height}}, 2322 postion of the correlation window on data is given by 2323 B{C{col}}, B{C{row}}. 2324 2325 If anything fails (data too close to boundary, etc.), 2326 function returns -1.0 (none correlation).. 2327 2328 2329 @param kernel_field: Kernel to correlate data field with. I{(L{DataField})} 2330 @param weight_field: data field of same size as kernel window size I{(L{DataField})} 2331 @param col: Upper-left column position in the data field. I{(int)} 2332 @param row: Upper-left row position in the data field. I{(int)} 2333 @param kernel_col: Upper-left column position in kernel field. I{(int)} 2334 @param kernel_row: Upper-left row position in kernel field. I{(int)} 2335 @param kernel_width: Width of kernel field area. I{(int)} 2336 @param kernel_height: Heigh of kernel field area. I{(int)} 2337 @return: Correlation score (between -1.0 and 1.0). Value 1.0 denotes 2338 maximum correlation, -1.0 none correlation. I{(float)} 2339 """ 2340 return None
2341
2342 - def crosscorrelate(data_field2, x_dist, y_dist, score, search_width, search_height, window_width, window_height):
2343 """ 2344 Algorithm for matching two different images of the same object under changes. 2345 2346 It does not use any special features 2347 for matching. It simply searches for all points (with their neighbourhood) 2348 of B{C{data_field1}} within B{C{data_field2}}. Parameters B{C{search_width}} and 2349 B{C{search_height}} 2350 determine maimum area where to search for points. The area is cenetered 2351 in the B{C{data_field2}} at former position of points at B{C{data_field1}}. 2352 2353 @param data_field2: A data field. I{(L{DataField})} 2354 @param x_dist: A data field to store x-distances to. I{(L{DataField})} 2355 @param y_dist: A data field to store y-distances to. I{(L{DataField})} 2356 @param score: Data field to store correlation scores to. I{(L{DataField})} 2357 @param search_width: Search area width. I{(int)} 2358 @param search_height: Search area height. I{(int)} 2359 @param window_width: Correlation window width. This parameter is not actually 2360 used. Pass zero. I{(int)} 2361 @param window_height: Correlation window height. This parameter is not actually 2362 used. Pass zero. I{(int)} 2363 """ 2364 pass
2365
2366 - def crosscorrelate_init(data_field2, x_dist, y_dist, score, search_width, search_height, window_width, window_height):
2367 """ 2368 Initializes a cross-correlation iterator. 2369 2370 This iterator reports its state as B{C{ComputationStateType}}. 2371 2372 2373 @param data_field2: A data field. I{(L{DataField})} 2374 @param x_dist: A data field to store x-distances to, or B{C{None}}. I{(L{DataField})} 2375 @param y_dist: A data field to store y-distances to, or B{C{None}}. I{(L{DataField})} 2376 @param score: Data field to store correlation scores to, or B{C{None}}. I{(L{DataField})} 2377 @param search_width: Search area width. I{(int)} 2378 @param search_height: Search area height. I{(int)} 2379 @param window_width: Correlation window width. I{(int)} 2380 @param window_height: Correlation window height. I{(int)} 2381 @return: A new cross-correlation iterator. I{(ComputationState*)} 2382 """ 2383 return None
2384
2385 - def correlate(kernel_field, score, method):
2386 """ 2387 Computes correlation score for all positions in a data field. 2388 2389 Correlation score is compute for all points in data field B{C{data_field}} 2390 and full size of correlation kernel B{C{kernel_field}}. 2391 2392 The points in B{C{score}} correspond to centers of kernel. More precisely, the 2393 point ((B{C{kxres}}-1)/2, (B{C{kyres}}-1)/2) in B{C{score}} corresponds to kernel field 2394 top left corner coincident with data field top left corner. Points outside 2395 the area where the kernel field fits into the data field completely are 2396 set to -1 for B{C{CORRELATION_NORMAL}}. 2397 2398 This function is mostly made obsolete by L{DataField.correlation_search}() 2399 which offers, beside the plain FFT-based correlation, a method equivalent to 2400 B{C{CORRELATION_NORMAL}} as well as several others, all computed efficiently 2401 using FFT. 2402 2403 @param kernel_field: Correlation kernel. I{(L{DataField})} 2404 @param score: Data field to store correlation scores to. I{(L{DataField})} 2405 @param method: Correlation score calculation method. Expected values: C{B{CORRELATION_NORMAL}}, C{B{CORRELATION_FFT}}, C{B{CORRELATION_POC}}. I{(L{CorrelationType})} 2406 """ 2407 pass
2408
2409 - def correlate_init(kernel_field, score):
2410 """ 2411 Creates a new correlation iterator. 2412 2413 This iterator reports its state as B{C{ComputationStateType}}. 2414 2415 This function is mostly made obsolete by L{DataField.correlation_search}() 2416 which offers, beside the plain FFT-based correlation, a method equivalent to 2417 B{C{CORRELATION_NORMAL}} as well as several others, all computed efficiently 2418 using FFT. 2419 2420 2421 @param kernel_field: Kernel to correlate data field with. I{(L{DataField})} 2422 @param score: Data field to store correlation scores to. I{(L{DataField})} 2423 @return: A new correlation iterator. I{(ComputationState*)} 2424 """ 2425 return None
2426
2427 - def correlation_search(kernel, kernel_weight, target, method, regcoeff, exterior, fill_value):
2428 """ 2429 Performs correlation search of a detail in a larger data field. 2430 2431 There are two basic classes of methods: Covariance (products of kernel and 2432 data values are summed) and height difference (squared differences between 2433 kernel and data values are summed). For the second class, the sign of the 2434 output is inverted. So in both cases higher values mean better match. 2435 All methods are implemented efficiently using FFT. 2436 2437 Usually you want to use B{C{CORR_SEARCH_COVARIANCE}} or 2438 B{C{CORR_SEARCH_HEIGHT_DIFF}}, in which the absolute data offsets play no 2439 role (only the differences). 2440 2441 If the detail can also occur with different height scales, use 2442 B{C{CORR_SEARCH_COVARIANCE_SCORE}} or B{C{CORR_SEARCH_HEIGHT_DIFF_SCORE}} in 2443 which the local data variance is normalised. In this case B{C{dfield}} regions 2444 with very small (or zero) variance can lead to odd results and spurious 2445 maxima. Use B{C{regcoeff}} to suppress them: Score of image details is 2446 suppressed if their variance is B{C{regcoeff}} times the mean local variance. 2447 2448 If B{C{kernel_weight}} is non-B{C{None}} is allows specify masking/weighting of 2449 kernel. The simplest use is masking when searching for a non-rectangular 2450 detail. Fill B{C{kernel_weight}} with 1s for important kernel pixels and with 0s 2451 for irrelevant pixels. However, you can use arbitrary non-negative weights. 2452 2453 @since: 2.50 2454 2455 @param kernel: Detail to find (kernel). I{(L{DataField})} 2456 @param kernel_weight: Kernel weight, or B{C{None}}. If given, its dimensions must 2457 match B{C{kernel}}. I{(L{DataField})} 2458 @param target: Data field to fill with the score. It will be resampled to match 2459 B{C{dfield}}. I{(L{DataField})} 2460 @param method: Method, determining the type of output to put into B{C{target}}. Expected values: C{B{CORR_SEARCH_COVARIANCE_RAW}}, C{B{CORR_SEARCH_COVARIANCE}}, C{B{CORR_SEARCH_COVARIANCE_SCORE}}, C{B{CORR_SEARCH_HEIGHT_DIFF_RAW}}, C{B{CORR_SEARCH_HEIGHT_DIFF}}, C{B{CORR_SEARCH_HEIGHT_DIFF_SCORE}}. I{(L{CorrSearchType})} 2461 @param regcoeff: Regularisation coefficient, any positive number. Pass something 2462 like 0.1 if unsure. You can also pass zero, it means the same 2463 as B{C{glib.MINDOUBLE}}. I{(float)} 2464 @param exterior: Exterior pixels handling. Expected values: C{B{EXTERIOR_UNDEFINED}}, C{B{EXTERIOR_BORDER_EXTEND}}, C{B{EXTERIOR_MIRROR_EXTEND}}, C{B{EXTERIOR_PERIODIC}}, C{B{EXTERIOR_FIXED_VALUE}}. I{(L{ExteriorType})} 2465 @param fill_value: The value to use with B{C{EXTERIOR_FIXED_VALUE}} exterior. I{(float)} 2466 """ 2467 pass
2468
2469 - def invalidate():
2470 """ 2471 Invalidates cached data field stats. 2472 2473 User code should rarely need this macro, as all B{C{DataField}} methods do 2474 proper invalidation when they change data, as well as 2475 L{DataField.get_data}() does. 2476 2477 However, if you get raw data with L{DataField.get_data}() and then mix 2478 direct changes to it with calls to methods like L{DataField.get_max}(), 2479 you may need to explicitely invalidate cached values to let 2480 L{DataField.get_max}() know it has to recompute the maximum. 2481 2482 """ 2483 pass
2484
2485 - def new_alike(nullme):
2486 """ 2487 Creates a new data field similar to an existing one. 2488 2489 Use L{DataField.duplicate}() if you want to copy a data field including 2490 data. 2491 2492 2493 @param nullme: Whether the data field should be initialized to zeroes. If B{C{False}}, 2494 the data will not be initialized. I{(bool)} 2495 @return: A newly created data field. I{(L{DataField})} 2496 """ 2497 return None
2498
2499 - def data_changed():
2500 """ 2501 Emits signal "data-changed" on a data field. 2502 2503 """ 2504 pass
2505
2506 - def new_resampled(xres, yres, interpolation):
2507 """ 2508 Creates a new data field by resampling an existing one. 2509 2510 This method is equivalent to L{DataField.duplicate}() followed by 2511 L{DataField.resample}(), but it is more efficient. 2512 2513 2514 @param xres: Desired X resolution. I{(int)} 2515 @param yres: Desired Y resolution. I{(int)} 2516 @param interpolation: Interpolation method to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 2517 @return: A newly created data field. I{(L{DataField})} 2518 """ 2519 return None
2520
2521 - def resample(xres, yres, interpolation):
2522 """ 2523 Resamples a data field using given interpolation method 2524 2525 This method may invalidate raw data buffer returned by 2526 L{DataField.get_data}(). 2527 2528 @param xres: Desired X resolution. I{(int)} 2529 @param yres: Desired Y resolution. I{(int)} 2530 @param interpolation: Interpolation method to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 2531 """ 2532 pass
2533
2534 - def resize(ulcol, ulrow, brcol, brrow):
2535 """ 2536 Resizes (crops) a data field. 2537 2538 Crops a data field to a rectangle between upper-left and bottom-right 2539 points, recomputing real size. 2540 2541 This method may invalidate raw data buffer returned by 2542 L{DataField.get_data}(). 2543 2544 @param ulcol: Upper-left column coordinate. I{(int)} 2545 @param ulrow: Upper-left row coordinate. I{(int)} 2546 @param brcol: Bottom-right column coordinate + 1. I{(int)} 2547 @param brrow: Bottom-right row coordinate + 1. I{(int)} 2548 """ 2549 pass
2550
2551 - def area_extract(col, row, width, height):
2552 """ 2553 Extracts a rectangular part of a data field to a new data field. 2554 2555 2556 @param col: Upper-left column coordinate. I{(int)} 2557 @param row: Upper-left row coordinate. I{(int)} 2558 @param width: Area width (number of columns). I{(int)} 2559 @param height: Area height (number of rows). I{(int)} 2560 @return: The extracted area as a newly created data field. I{(L{DataField})} 2561 """ 2562 return None
2563
2564 - def copy(dest, nondata_too):
2565 """ 2566 Copies the contents of an already allocated data field to a data field 2567 of the same size. 2568 2569 @param dest: Destination data field. I{(L{DataField})} 2570 @param nondata_too: Whether non-data (units) should be copied too. I{(bool)} 2571 """ 2572 pass
2573
2574 - def area_copy(dest, col, row, width, height, destcol, destrow):
2575 """ 2576 Copies a rectangular area from one data field to another. 2577 2578 The area starts at (B{C{col}}, B{C{row}}) in B{C{src}} and its dimension is B{C{width}}*B{C{height}}. 2579 It is copied to B{C{dest}} starting from (B{C{destcol}}, B{C{destrow}}). 2580 2581 The source area has to be completely contained in B{C{src}}. No assumptions are 2582 made about destination position, however, parts of the source area sticking 2583 out the destination data field B{C{dest}} are cut off. 2584 2585 If B{C{src}} is equal to B{C{dest}}, the areas may not overlap. 2586 2587 @param dest: Destination data field. I{(L{DataField})} 2588 @param col: Area upper-left column coordinate in B{C{src}}. I{(int)} 2589 @param row: Area upper-left row coordinate B{C{src}}. I{(int)} 2590 @param width: Area width (number of columns), pass -1 for full B{C{src}} widdth. I{(int)} 2591 @param height: Area height (number of rows), pass -1 for full B{C{src}} height. I{(int)} 2592 @param destcol: Destination column in B{C{dest}}. I{(int)} 2593 @param destrow: Destination row in B{C{dest}}. I{(int)} 2594 """ 2595 pass
2596
2597 - def get_xres():
2598 """ 2599 Gets X resolution (number of columns) of a data field. 2600 2601 2602 @return: X resolution. I{(int)} 2603 """ 2604 return None
2605
2606 - def get_yres():
2607 """ 2608 Gets Y resolution (number of rows) of the field. 2609 2610 2611 @return: Y resolution. I{(int)} 2612 """ 2613 return None
2614
2615 - def get_xreal():
2616 """ 2617 Gets the X real (physical) size of a data field. 2618 2619 2620 @return: X real size value. I{(float)} 2621 """ 2622 return None
2623
2624 - def get_yreal():
2625 """ 2626 Gets the Y real (physical) size of a data field. 2627 2628 2629 @return: Y real size value. I{(float)} 2630 """ 2631 return None
2632
2633 - def set_xreal(xreal):
2634 """ 2635 Sets X real (physical) size value of a data field. 2636 2637 @param xreal: New X real size value. I{(float)} 2638 """ 2639 pass
2640
2641 - def set_yreal(yreal):
2642 """ 2643 Sets Y real (physical) size value of a data field. 2644 2645 @param yreal: New Y real size value. I{(float)} 2646 """ 2647 pass
2648
2649 - def get_xoffset():
2650 """ 2651 Gets the X offset of data field origin. 2652 2653 2654 @return: X offset value. I{(float)} 2655 """ 2656 return None
2657
2658 - def get_yoffset():
2659 """ 2660 Gets the Y offset of data field origin. 2661 2662 2663 @return: Y offset value. I{(float)} 2664 """ 2665 return None
2666
2667 - def set_xoffset(xoff):
2668 """ 2669 Sets the X offset of a data field origin. 2670 2671 Note offsets don't affect any calculation, nor functions like 2672 L{DataField.rtoj}(). 2673 2674 @param xoff: New X offset value. I{(float)} 2675 """ 2676 pass
2677
2678 - def set_yoffset(yoff):
2679 """ 2680 Sets the Y offset of a data field origin. 2681 2682 Note offsets don't affect any calculation, nor functions like 2683 L{DataField.rtoi}(). 2684 2685 @param yoff: New Y offset value. I{(float)} 2686 """ 2687 pass
2688
2689 - def get_si_unit_xy():
2690 """ 2691 Returns lateral SI unit of a data field. 2692 2693 2694 @return: SI unit corresponding to the lateral (XY) dimensions of the data 2695 field. Its reference count is not incremented. I{(L{SIUnit})} 2696 """ 2697 return None
2698
2699 - def get_si_unit_z():
2700 """ 2701 Returns value SI unit of a data field. 2702 2703 2704 @return: SI unit corresponding to the "height" (Z) dimension of the data 2705 field. Its reference count is not incremented. I{(L{SIUnit})} 2706 """ 2707 return None
2708
2709 - def set_si_unit_xy(si_unit):
2710 """ 2711 Sets the SI unit corresponding to the lateral (XY) dimensions of a data 2712 field. 2713 2714 It does not assume a reference on B{C{si_unit}}, instead it adds its own 2715 reference. 2716 2717 @param si_unit: SI unit to be set. I{(L{SIUnit})} 2718 """ 2719 pass
2720
2721 - def set_si_unit_z(si_unit):
2722 """ 2723 Sets the SI unit corresponding to the "height" (Z) dimension of a data 2724 field. 2725 2726 It does not assume a reference on B{C{si_unit}}, instead it adds its own 2727 reference. 2728 2729 @param si_unit: SI unit to be set. I{(L{SIUnit})} 2730 """ 2731 pass
2732
2733 - def get_value_format_xy(style):
2734 """ 2735 Finds value format good for displaying coordinates of a data field. 2736 2737 2738 @param style: Unit format style. Expected values: C{B{SI_UNIT_FORMAT_NONE}}, C{B{SI_UNIT_FORMAT_PLAIN}}, C{B{SI_UNIT_FORMAT_MARKUP}}, C{B{SI_UNIT_FORMAT_VFMARKUP}}, C{B{SI_UNIT_FORMAT_TEX}}, C{B{SI_UNIT_FORMAT_VFTEX}}, C{B{SI_UNIT_FORMAT_UNICODE}}, C{B{SI_UNIT_FORMAT_VFUNICODE}}. I{(L{SIUnitFormatStyle})} 2739 @return: Tuple consisting of 2 values (B{C{value}}, B{C{format}}). (I{(L{SIValueFormat})}, I{(SkipArg)}) 2740 """ 2741 return None, None
2742
2743 - def get_value_format_z(style):
2744 """ 2745 Finds value format good for displaying values of a data field. 2746 2747 2748 @param style: Unit format style. Expected values: C{B{SI_UNIT_FORMAT_NONE}}, C{B{SI_UNIT_FORMAT_PLAIN}}, C{B{SI_UNIT_FORMAT_MARKUP}}, C{B{SI_UNIT_FORMAT_VFMARKUP}}, C{B{SI_UNIT_FORMAT_TEX}}, C{B{SI_UNIT_FORMAT_VFTEX}}, C{B{SI_UNIT_FORMAT_UNICODE}}, C{B{SI_UNIT_FORMAT_VFUNICODE}}. I{(L{SIUnitFormatStyle})} 2749 @return: Tuple consisting of 2 values (B{C{value}}, B{C{format}}). (I{(L{SIValueFormat})}, I{(SkipArg)}) 2750 """ 2751 return None, None
2752
2753 - def copy_units(target):
2754 """ 2755 Sets lateral and value units of a data field to match another data field. 2756 2757 @since: 2.49 2758 2759 @param target: Target data field. I{(L{DataField})} 2760 """ 2761 pass
2762
2763 - def copy_units_to_data_line(data_line):
2764 """ 2765 Sets lateral and value units of a data line to match a data field. 2766 2767 @param data_line: A data line to set units of. I{(L{DataLine})} 2768 """ 2769 pass
2770
2771 - def itor(row):
2772 """ 2773 Transforms vertical pixel coordinate to real (physical) Y coordinate. 2774 2775 That is it maps range [0..y-resolution] to range [0..real-y-size]. 2776 It is not suitable for conversion of matrix indices to physical coordinates, 2777 you have to use L{DataField.itor}(B{C{data_field}}, B{C{row}} + 0.5) for that. 2778 2779 2780 @param row: Vertical pixel coordinate. I{(float)} 2781 @return: Real Y coordinate. I{(float)} 2782 """ 2783 return None
2784
2785 - def jtor(col):
2786 """ 2787 Transforms horizontal pixel coordinate to real (physical) X coordinate. 2788 2789 That is it maps range [0..x-resolution] to range [0..real-x-size]. 2790 It is not suitable for conversion of matrix indices to physical coordinates, 2791 you have to use L{DataField.jtor}(B{C{data_field}}, B{C{col}} + 0.5) for that. 2792 2793 2794 @param col: Horizontal pixel coordinate. I{(float)} 2795 @return: Real X coordinate. I{(float)} 2796 """ 2797 return None
2798
2799 - def rtoi(realy):
2800 """ 2801 Transforms real (physical) Y coordinate to row. 2802 2803 That is it maps range [0..real-y-size] to range [0..y-resolution]. 2804 2805 2806 @param realy: Real (physical) Y coordinate. I{(float)} 2807 @return: Vertical pixel coodinate. I{(float)} 2808 """ 2809 return None
2810
2811 - def rtoj(realx):
2812 """ 2813 Transforms real (physical) X coordinate to column. 2814 2815 That is it maps range [0..real-x-size] to range [0..x-resolution]. 2816 2817 2818 @param realx: Real (physical) X coodinate. I{(float)} 2819 @return: Horizontal pixel coordinate. I{(float)} 2820 """ 2821 return None
2822
2823 - def get_val(col, row):
2824 """ 2825 Gets value at given position in a data field. 2826 2827 Do not access data with this function inside inner loops, it's slow. 2828 Get the raw data buffer with L{DataField.get_data_const}() and access it 2829 directly instead. 2830 2831 2832 @param col: Column index. I{(int)} 2833 @param row: Row index. I{(int)} 2834 @return: Value at (B{C{col}}, B{C{row}}). I{(float)} 2835 """ 2836 return None
2837
2838 - def set_val(col, row, value):
2839 """ 2840 Sets value at given position in a data field. 2841 2842 Do not set data with this function inside inner loops, it's slow. Get the 2843 raw data buffer with L{DataField.get_data}() and write to it directly 2844 instead. 2845 2846 @param col: Column index. I{(int)} 2847 @param row: Row index. I{(int)} 2848 @param value: Value to set. I{(float)} 2849 """ 2850 pass
2851
2852 - def get_dval(x, y, interpolation):
2853 """ 2854 Gets interpolated value at arbitrary data field point indexed by pixel 2855 coordinates. 2856 2857 Note pixel values are centered in pixels, so to get the same 2858 value as L{DataField.get_val}(B{C{data_field}}, B{C{j}}, B{C{i}}) returns, 2859 it's necessary to add 0.5: 2860 L{DataField.get_dval}(B{C{data_field}}, B{C{j}}+0.5, B{C{i}}+0.5, B{C{interpolation}}). 2861 2862 See also L{DataField.get_dval_real}() that does the same, but takes 2863 real coordinates. 2864 2865 2866 @param x: Horizontal position in pixel units, in range [0, x-resolution]. I{(float)} 2867 @param y: Vertical postition in pixel units, in range [0, y-resolution]. I{(float)} 2868 @param interpolation: Interpolation method to be used. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 2869 @return: Interpolated value at position (B{C{x}},B{C{y}}). I{(float)} 2870 """ 2871 return None
2872
2873 - def get_dval_real(x, y, interpolation):
2874 """ 2875 Gets interpolated value at arbitrary data field point indexed by real 2876 coordinates. 2877 2878 See also L{DataField.get_dval}() that does the same, but takes pixel 2879 coordinates. 2880 2881 2882 @param x: X postion in real coordinates. I{(float)} 2883 @param y: Y postition in real coordinates. I{(float)} 2884 @param interpolation: Interpolation method to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 2885 @return: Value at position (B{C{x}},B{C{y}}). I{(float)} 2886 """ 2887 return None
2888
2889 - def rotate(angle, interpolation):
2890 """ 2891 Rotates a data field by a given angle. 2892 2893 This function is mostly obsolete. See L{DataField.new_rotated}() 2894 and L{DataField.new_rotated_90}(). 2895 2896 Values that get outside of data field by the rotation are lost. 2897 Undefined values from outside of data field that get inside are set to 2898 data field minimum value. 2899 2900 The rotation is performed in pixel space, i.e. it can be in fact a more 2901 general affine transform in the real coordinates when pixels are not square. 2902 2903 @param angle: Rotation angle (in radians). I{(float)} 2904 @param interpolation: Interpolation method to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 2905 """ 2906 pass
2907
2908 - def new_rotated(exterior_mask, angle, interp, resize):
2909 """ 2910 Creates a new data field by rotating a data field by an atribtrary angle. 2911 2912 The returned data field can have pixel corresponding to exterior in B{C{dfield}} 2913 (unless B{C{resize}} is B{C{ROTATE_RESIZE_CUT}}). They are filled with a neutral 2914 value; pass B{C{exterior_mask}} and replace them as you wish if you need more 2915 control. 2916 2917 The rotation is performed in real space, i.e. it is a more general affine 2918 transform in the pixel space for data field with non-square pixels. 2919 See L{DataField.rotate}() which rotates in the pixel space. 2920 2921 The returned data field has usually square pixels, the exception being when 2922 B{C{angle}} is a multiple of B{C{glib.PI}}/2 when the function reduces to 2923 L{DataField.new_rotated_90}() and original pixels are preserved. This is 2924 of concern only when B{C{dfield}} has non-square pixels. 2925 2926 @since: 2.46 2927 2928 @param exterior_mask: Optional data field where pixels corresponding to exterior 2929 will be set to 1. It will be resized to match the returned 2930 field. I{(L{DataField})} 2931 @param angle: Rotation angle (in radians). I{(float)} 2932 @param interp: Interpolation type to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 2933 @param resize: Controls how the result size is determined. Expected values: C{B{ROTATE_RESIZE_SAME_SIZE}}, C{B{ROTATE_RESIZE_EXPAND}}, C{B{ROTATE_RESIZE_CUT}}. I{(L{RotateResizeType})} 2934 @return: A newly created data field. I{(L{DataField})} 2935 """ 2936 return None
2937
2938 - def new_rotated_90(clockwise):
2939 """ 2940 Creates a new data field by rotating a data field by 90 degrees. 2941 2942 @since: 2.46 2943 2944 @param clockwise: B{C{True}} to rotate clocwise, B{C{False}} to rotate anti-clockwise. I{(bool)} 2945 @return: A newly created data field. I{(L{DataField})} 2946 """ 2947 return None
2948
2949 - def invert(x, y, z):
2950 """ 2951 Reflects amd/or inverts a data field. 2952 2953 In the case of value reflection, it's inverted about the mean value. 2954 2955 @param x: B{C{True}} to reflect about X axis (i.e., invert columns vertically). I{(bool)} 2956 @param y: B{C{True}} to reflect about Y axis (i.e., invert rows horizontally). I{(bool)} 2957 @param z: B{C{True}} to invert in Z direction (i.e., invert values). I{(bool)} 2958 """ 2959 pass
2960
2961 - def flip_xy(dest, minor):
2962 """ 2963 Copies data from one data field to another with transposition. 2964 2965 The destination data field is resized as necessary, its real dimensions set 2966 to transposed B{C{src}} dimensions and its offsets are reset. Units are not 2967 updated. 2968 2969 @since: 2.49 2970 2971 @param dest: Destination data field. I{(L{DataField})} 2972 @param minor: B{C{True}} to mirror about the minor diagonal; B{C{False}} to mirror about 2973 major diagonal. I{(bool)} 2974 """ 2975 pass
2976
2977 - def area_flip_xy(col, row, width, height, dest, minor):
2978 """ 2979 Copies data from a rectangular part of one data field to another with 2980 transposition. 2981 2982 The destination data field is resized as necessary, its real dimensions set 2983 to transposed B{C{src}} area dimensions and its offsets are reset. Units are not 2984 updated. 2985 2986 @since: 2.49 2987 2988 @param col: Upper-left column coordinate in B{C{src}}. I{(int)} 2989 @param row: Upper-left row coordinate in B{C{src}}. I{(int)} 2990 @param width: Area width (number of columns) in B{C{src}}. I{(int)} 2991 @param height: Area height (number of rows) in B{C{src}}. I{(int)} 2992 @param dest: Destination data field. I{(L{DataField})} 2993 @param minor: B{C{True}} to mirror about the minor diagonal; B{C{False}} to mirror about 2994 major diagonal. I{(bool)} 2995 """ 2996 pass
2997
2998 - def fill(value):
2999 """ 3000 Fills a data field with given value. 3001 3002 @param value: Value to be entered. I{(float)} 3003 """ 3004 pass
3005
3006 - def clear():
3007 """ 3008 Fills a data field with zeroes. 3009 3010 """ 3011 pass
3012
3013 - def multiply(value):
3014 """ 3015 Multiplies all values in a data field by given value. 3016 3017 @param value: Value to multiply B{C{data_field}} with. I{(float)} 3018 """ 3019 pass
3020
3021 - def add(value):
3022 """ 3023 Adds given value to all values in a data field. 3024 3025 @param value: Value to be added to data field values. I{(float)} 3026 """ 3027 pass
3028
3029 - def area_fill(col, row, width, height, value):
3030 """ 3031 Fills a rectangular part of a data field with given value. 3032 3033 @param col: Upper-left column coordinate. I{(int)} 3034 @param row: Upper-left row coordinate. I{(int)} 3035 @param width: Area width (number of columns). I{(int)} 3036 @param height: Area height (number of rows). I{(int)} 3037 @param value: Value to be entered I{(float)} 3038 """ 3039 pass
3040
3041 - def area_fill_mask(mask, mode, col, row, width, height, value):
3042 """ 3043 Fills a masked rectangular part of a data field with given value. 3044 3045 @since: 2.44 3046 3047 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 3048 @param mode: Masking mode to use. See the introduction for description of 3049 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 3050 @param col: Upper-left column coordinate. I{(int)} 3051 @param row: Upper-left row coordinate. I{(int)} 3052 @param width: Area width (number of columns). I{(int)} 3053 @param height: Area height (number of rows). I{(int)} 3054 @param value: Value to be entered I{(float)} 3055 """ 3056 pass
3057
3058 - def area_clear(col, row, width, height):
3059 """ 3060 Fills a rectangular part of a data field with zeroes. 3061 3062 @param col: Upper-left column coordinate. I{(int)} 3063 @param row: Upper-left row coordinate. I{(int)} 3064 @param width: Area width (number of columns). I{(int)} 3065 @param height: Area height (number of rows). I{(int)} 3066 """ 3067 pass
3068
3069 - def area_multiply(col, row, width, height, value):
3070 """ 3071 Multiplies values in a rectangular part of a data field by given value 3072 3073 @param col: Upper-left column coordinate. I{(int)} 3074 @param row: Upper-left row coordinate. I{(int)} 3075 @param width: Area width (number of columns). I{(int)} 3076 @param height: Area height (number of rows). I{(int)} 3077 @param value: Value to multiply area with. I{(float)} 3078 """ 3079 pass
3080
3081 - def area_add(col, row, width, height, value):
3082 """ 3083 Adds given value to all values in a rectangular part of a data field. 3084 3085 @param col: Upper-left column coordinate. I{(int)} 3086 @param row: Upper-left row coordinate. I{(int)} 3087 @param width: Area width (number of columns). I{(int)} 3088 @param height: Area height (number of rows). I{(int)} 3089 @param value: Value to be added to area values. I{(float)} 3090 """ 3091 pass
3092
3093 - def get_profile(scol, srow, ecol, erow, res, thickness, interpolation):
3094 """ 3095 Extracts a possibly averaged profile from data field to a data line. 3096 3097 3098 @param scol: The column the line starts at (inclusive). I{(int)} 3099 @param srow: The row the line starts at (inclusive). I{(int)} 3100 @param ecol: The column the line ends at (inclusive). I{(int)} 3101 @param erow: The row the line ends at (inclusive). I{(int)} 3102 @param res: Requested resolution of data line (the number of samples to take). 3103 If nonpositive, data line resolution is chosen to match B{C{data_field}}'s. I{(int)} 3104 @param thickness: Thickness of line to be averaged. I{(int)} 3105 @param interpolation: Interpolation type to use. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 3106 @return: Tuple consisting of 2 values (B{C{value}}, B{C{data_line}}). (I{(L{DataLine})}, I{(SkipArg)}) 3107 """ 3108 return None, None
3109
3110 - def get_row(data_line, row):
3111 """ 3112 Extracts a data field row into a data line. 3113 3114 @param data_line: A data line. It will be resized to width ot B{C{data_field}}. I{(L{DataLine})} 3115 @param row: Row index. I{(int)} 3116 """ 3117 pass
3118
3119 - def get_column(data_line, col):
3120 """ 3121 Extracts a data field column into a data line. 3122 3123 @param data_line: A data line. It will be resized to height of B{C{data_field}}. I{(L{DataLine})} 3124 @param col: Column index. I{(int)} 3125 """ 3126 pass
3127
3128 - def set_row(data_line, row):
3129 """ 3130 Sets a row in the data field to values of a data line. 3131 3132 Data line length must be equal to width of data field. 3133 3134 @param data_line: A data line. I{(L{DataLine})} 3135 @param row: Row index. I{(int)} 3136 """ 3137 pass
3138
3139 - def set_column(data_line, col):
3140 """ 3141 Sets a column in the data field to values of a data line. 3142 3143 Data line length must be equal to height of data field. 3144 3145 @param data_line: A data line. I{(L{DataLine})} 3146 @param col: Column index. I{(int)} 3147 """ 3148 pass
3149
3150 - def get_row_part(data_line, row, from_, to):
3151 """ 3152 Extracts part of a data field row into a data line. 3153 3154 @param data_line: A data line. It will be resized to the row part width. I{(L{DataLine})} 3155 @param row: Row index. I{(int)} 3156 @param from_: I{(int)} 3157 @param to: End column index + 1. I{(int)} 3158 """ 3159 pass
3160
3161 - def get_column_part(data_line, col, from_, to):
3162 """ 3163 Extracts part of a data field column into a data line. 3164 3165 @param data_line: A data line. It will be resized to the column part height. I{(L{DataLine})} 3166 @param col: Column index. I{(int)} 3167 @param from_: I{(int)} 3168 @param to: End row index + 1. I{(int)} 3169 """ 3170 pass
3171
3172 - def set_row_part(data_line, row, from_, to):
3173 """ 3174 Puts a data line into a data field row. 3175 3176 If data line length differs from B{C{to}}-B{C{from}}, it is resampled to this length. 3177 3178 @param data_line: A data line. I{(L{DataLine})} 3179 @param row: Row index. I{(int)} 3180 @param from_: I{(int)} 3181 @param to: End row index + 1. I{(int)} 3182 """ 3183 pass
3184
3185 - def set_column_part(data_line, col, from_, to):
3186 """ 3187 Puts a data line into data field column. 3188 3189 If data line length differs from B{C{to}}-B{C{from}}, it is resampled to this length. 3190 3191 @param data_line: A data line. I{(L{DataLine})} 3192 @param col: Column index. I{(int)} 3193 @param from_: I{(int)} 3194 @param to: End row index + 1. I{(int)} 3195 """ 3196 pass
3197
3198 - def get_xder(col, row):
3199 """ 3200 Computes central derivative in X direction. 3201 3202 On border points, one-side derivative is returned. 3203 3204 3205 @param col: Column index. I{(int)} 3206 @param row: Row index. I{(int)} 3207 @return: Derivative in X direction. I{(float)} 3208 """ 3209 return None
3210
3211 - def get_yder(col, row):
3212 """ 3213 Computes central derivative in Y direction. 3214 3215 On border points, one-side derivative is returned. 3216 3217 Note the derivative is for legacy reasons calulcated for the opposite 3218 y direction than is usual elsewhere in Gwyddion, i.e. if values increase 3219 with increasing row number, the returned value is negative. 3220 3221 3222 @param col: Column index. I{(int)} 3223 @param row: Row index. I{(int)} 3224 @return: Derivative in Y direction I{(float)} 3225 """ 3226 return None
3227
3228 - def get_angder(col, row, theta):
3229 """ 3230 Computes derivative in direction specified by given angle. 3231 3232 3233 @param col: Column index. I{(int)} 3234 @param row: Row index. I{(int)} 3235 @param theta: Angle defining the direction (in radians, counterclockwise). I{(float)} 3236 @return: Derivative in direction given by angle B{C{theta}}. I{(float)} 3237 """ 3238 return None
3239
3240 - def average_xyz(density_map, points, npoints):
3241 """ 3242 Fills a data field with regularised XYZ data using a simple method. 3243 3244 The real dimensions and offsets of B{C{field}} determine the rectangle in the XY 3245 plane that will be regularised. The regularisation method is fast but 3246 simple and there are no absolute guarantees of quality, even though the 3247 result will be usually quite acceptable. 3248 3249 This especially applies to reasonable views of the XYZ data. Unreasonable 3250 views can be rendered unreasonably. In particular if the rectangle does not 3251 contain any point from B{C{points}} (either due to high zoom to an empty region 3252 or by just being completely off) B{C{data_field}} will be filled entirely with 3253 the value of the closest point or something similar. 3254 3255 @since: 2.44 3256 3257 @param density_map: Optional data field to fill with XYZ point density map. It can 3258 be B{C{None}}. I{(L{DataField})} 3259 @param points: Array of XYZ points. Coordinates X and Y represent positions in 3260 the plane; the Z-coordinate represents values. I{(const-XYZ*)} 3261 @param npoints: Number of points. I{(int)} 3262 """ 3263 pass
3264
3265 - def xdwt(wt_coefs, direction, minsize):
3266 """ 3267 Performs steps of the X-direction image wavelet decomposition. 3268 3269 The smallest low pass coefficients block is equal to B{C{minsize}}. Run with 3270 B{C{minsize}} = B{C{dfield}}->xres/2 to perform one step of decomposition 3271 or B{C{minsize}} = 4 to perform full decomposition (or anything between). 3272 3273 3274 @param wt_coefs: Data line where the wavelet transform coefficients are stored. I{(L{DataLine})} 3275 @param direction: Transform direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 3276 @param minsize: size of minimal transform result block I{(int)} 3277 """ 3278 pass
3279
3280 - def ydwt(wt_coefs, direction, minsize):
3281 """ 3282 Performs steps of the Y-direction image wavelet decomposition. 3283 3284 The smallest low pass coefficients block is equal to B{C{minsize}}. Run with 3285 B{C{minsize}} = B{C{dfield}}->yres/2 to perform one step of decomposition 3286 or B{C{minsize}} = 4 to perform full decomposition (or anything between). 3287 3288 3289 @param wt_coefs: Data line where the wavelet transform coefficients are stored. I{(L{DataLine})} 3290 @param direction: Transform direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 3291 @param minsize: size of minimal transform result block I{(int)} 3292 """ 3293 pass
3294
3295 - def dwt(wt_coefs, direction, minsize):
3296 """ 3297 Performs steps of the 2D image wavelet decomposition. 3298 3299 The smallest low pass coefficients block is equal to B{C{minsize}}. Run with 3300 B{C{minsize}} = B{C{dfield}}->xres/2 to perform one step of decomposition 3301 or B{C{minsize}} = 4 to perform full decomposition (or anything between). 3302 3303 3304 @param wt_coefs: Data line where the wavelet transform coefficients are stored. I{(L{DataLine})} 3305 @param direction: Transform direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 3306 @param minsize: size of minimal transform result block I{(int)} 3307 """ 3308 pass
3309
3310 - def dwt_mark_anisotropy(mask, wt_coefs, ratio, lowlimit):
3311 """ 3312 Performs steps of the 2D image wavelet decomposition. 3313 3314 The smallest low pass coefficients block is equal to B{C{minsize}}. Run with 3315 B{C{minsize}} = B{C{dfield}}->xres/2 to perform one step of decomposition 3316 or B{C{minsize}} = 4 to perform full decomposition (or anything between). 3317 3318 3319 @param mask: I{(L{DataField})} 3320 @param wt_coefs: Data line to store wavelet transform coefficients to. I{(L{DataLine})} 3321 @param ratio: I{(float)} 3322 @param lowlimit: I{(int)} 3323 """ 3324 pass
3325
3326 - def elliptic_area_fill(col, row, width, height, value):
3327 """ 3328 Fills an elliptic region of a data field with given value. 3329 3330 The elliptic region is defined by its bounding box which must be completely 3331 contained in the data field. 3332 3333 3334 @param col: Upper-left bounding box column coordinate. I{(int)} 3335 @param row: Upper-left bounding box row coordinate. I{(int)} 3336 @param width: Bounding box width (number of columns). I{(int)} 3337 @param height: Bounding box height (number of rows). I{(int)} 3338 @param value: Value to be entered. I{(float)} 3339 @return: The number of filled values. I{(int)} 3340 """ 3341 return None
3342
3343 - def circular_area_fill(col, row, radius, value):
3344 """ 3345 Fills an elliptic region of a data field with given value. 3346 3347 3348 @param col: Row index of circular area centre. I{(int)} 3349 @param row: Column index of circular area centre. I{(int)} 3350 @param radius: Circular area radius (in pixels). Any value is allowed, although 3351 to get areas that do not deviate from true circles after 3352 pixelization too much, half-integer values are recommended, 3353 integer values are NOT recommended. I{(float)} 3354 @param value: Value to be entered. I{(float)} 3355 @return: The number of filled values. I{(int)} 3356 """ 3357 return None
3358
3359 - def normalize():
3360 """ 3361 Normalizes data in a data field to range 0.0 to 1.0. 3362 3363 It is equivalent to L{DataField.renormalize}(B{C{data_field}}, 1.0, 0.0); 3364 3365 If B{C{data_field}} is filled with only one value, it is changed to 0.0. 3366 3367 """ 3368 pass
3369
3370 - def renormalize(range, offset):
3371 """ 3372 Transforms data in a data field with linear function to given range. 3373 3374 When B{C{range}} is positive, the new data range is (B{C{offset}}, B{C{offset}}+B{C{range}}); 3375 when B{C{range}} is negative, the new data range is (B{C{offset}}-B{C{range}}, B{C{offset}}). 3376 In neither case the data are flipped, negative range only means different 3377 selection of boundaries. 3378 3379 When B{C{range}} is zero, this method is equivalent to 3380 L{DataField.fill}(B{C{data_field}}, B{C{offset}}). 3381 3382 @param range: New data interval size. I{(float)} 3383 @param offset: New data interval offset. I{(float)} 3384 """ 3385 pass
3386
3387 - def area_renormalize(col, row, width, height, range, offset):
3388 """ 3389 Transforms data in a part of a data field with linear function to given 3390 range. 3391 3392 When B{C{range}} is positive, the new data range is (B{C{offset}}, B{C{offset}}+B{C{range}}); 3393 when B{C{range}} is negative, the new data range is (B{C{offset}}-B{C{range}}, B{C{offset}}). 3394 In neither case the data are flipped, negative range only means different 3395 selection of boundaries. 3396 3397 When B{C{range}} is zero, this method is equivalent to 3398 L{DataField.fill}(B{C{data_field}}, B{C{offset}}). 3399 3400 @since: 2.45 3401 3402 @param col: Upper-left column coordinate. I{(int)} 3403 @param row: Upper-left row coordinate. I{(int)} 3404 @param width: Area width (number of columns). I{(int)} 3405 @param height: Area height (number of rows). I{(int)} 3406 @param range: New data interval size. I{(float)} 3407 @param offset: New data interval offset. I{(float)} 3408 """ 3409 pass
3410
3411 - def threshold(threshval, bottom, top):
3412 """ 3413 Tresholds values of a data field. 3414 3415 Values smaller than B{C{threshold}} are set to value B{C{bottom}}, values higher 3416 than B{C{threshold}} or equal to it are set to value B{C{top}} 3417 3418 3419 @param threshval: Threshold value. I{(float)} 3420 @param bottom: Lower replacement value. I{(float)} 3421 @param top: Upper replacement value. I{(float)} 3422 @return: The total number of values above threshold. I{(int)} 3423 """ 3424 return None
3425
3426 - def area_threshold(col, row, width, height, threshval, bottom, top):
3427 """ 3428 Tresholds values of a rectangular part of a data field. 3429 3430 Values smaller than B{C{threshold}} are set to value B{C{bottom}}, values higher 3431 than B{C{threshold}} or equal to it are set to value B{C{top}} 3432 3433 3434 @param col: Upper-left column coordinate. I{(int)} 3435 @param row: Upper-left row coordinate. I{(int)} 3436 @param width: Area width (number of columns). I{(int)} 3437 @param height: Area height (number of rows). I{(int)} 3438 @param threshval: Threshold value. I{(float)} 3439 @param bottom: Lower replacement value. I{(float)} 3440 @param top: Upper replacement value. I{(float)} 3441 @return: The total number of values above threshold. I{(int)} 3442 """ 3443 return None
3444
3445 - def clamp(bottom, top):
3446 """ 3447 Limits data field values to a range. 3448 3449 3450 @param bottom: Lower limit value. I{(float)} 3451 @param top: Upper limit value. I{(float)} 3452 @return: The number of changed values, i.e., values that were outside 3453 [B{C{bottom}}, B{C{top}}]. I{(int)} 3454 """ 3455 return None
3456
3457 - def area_clamp(col, row, width, height, bottom, top):
3458 """ 3459 Limits values in a rectangular part of a data field to a range. 3460 3461 3462 @param col: Upper-left column coordinate. I{(int)} 3463 @param row: Upper-left row coordinate. I{(int)} 3464 @param width: Area width (number of columns). I{(int)} 3465 @param height: Area height (number of rows). I{(int)} 3466 @param bottom: Lower limit value. I{(float)} 3467 @param top: Upper limit value. I{(float)} 3468 @return: The number of changed values, i.e., values that were outside 3469 [B{C{bottom}}, B{C{top}}]. I{(int)} 3470 """ 3471 return None
3472
3473 - def area_gather(result, buffer, hsize, vsize, average, col, row, width, height):
3474 """ 3475 Sums or averages values in reactangular areas around each sample in a data 3476 field. 3477 3478 When the gathered area extends out of calculation area, only samples from 3479 their intersection are taken into the local sum (or average). 3480 3481 There are no restrictions on values of B{C{hsize}} and B{C{vsize}} with regard to 3482 B{C{width}} and B{C{height}}, but they have to be positive. 3483 3484 The result is calculated by the means of two-dimensional rolling sums. 3485 One one hand it means the calculation time depends linearly on 3486 (B{C{width}} + B{C{hsize}})*(B{C{height}} + B{C{vsize}}) instead of 3487 B{C{width}}*B{C{hsize}}*B{C{height}}*B{C{vsize}}. On the other hand it means absolute rounding 3488 errors of all output values are given by the largest input values, that is 3489 relative precision of results small in absolute value may be poor. 3490 3491 @param result: A data field to put the result to, it may be B{C{data_field}} itself. I{(L{DataField})} 3492 @param buffer: A data field to use as a scratch area, its size must be at least 3493 B{C{width}}*B{C{height}}. May be B{C{None}} to allocate a private temporary 3494 buffer. I{(L{DataField})} 3495 @param hsize: Horizontal size of gathered area. The area is centered around 3496 each sample if B{C{hsize}} is odd, it extends one pixel more to the 3497 right if B{C{hsize}} is even. I{(int)} 3498 @param vsize: Vertical size of gathered area. The area is centered around 3499 each sample if B{C{vsize}} is odd, it extends one pixel more down 3500 if B{C{vsize}} is even. I{(int)} 3501 @param average: B{C{True}} to divide resulting sums by the number of involved samples 3502 to get averages instead of sums. I{(bool)} 3503 @param col: Upper-left column coordinate. I{(int)} 3504 @param row: Upper-left row coordinate. I{(int)} 3505 @param width: Area width (number of columns). I{(int)} 3506 @param height: Area height (number of rows). I{(int)} 3507 """ 3508 pass
3509
3510 - def convolve(kernel_field):
3511 """ 3512 Convolves a data field with given kernel. 3513 3514 @param kernel_field: Kenrel field to convolve B{C{data_field}} with. I{(L{DataField})} 3515 """ 3516 pass
3517
3518 - def area_convolve(kernel_field, col, row, width, height):
3519 """ 3520 Convolves a rectangular part of a data field with given kernel. 3521 3522 @param kernel_field: Kenrel field to convolve B{C{data_field}} with. I{(L{DataField})} 3523 @param col: Upper-left column coordinate. I{(int)} 3524 @param row: Upper-left row coordinate. I{(int)} 3525 @param width: Area width (number of columns). I{(int)} 3526 @param height: Area height (number of rows). I{(int)} 3527 """ 3528 pass
3529
3530 - def area_ext_convolve(col, row, width, height, target, kernel, exterior, fill_value, as_integral):
3531 """ 3532 Convolve a field with a two-dimensional kernel. 3533 3534 Pixel dimensions of B{C{target}} may match either B{C{field}} or just the rectangular 3535 area. In the former case the result is written in the same rectangular 3536 area; in the latter case the result fills the entire B{C{target}}. 3537 3538 The convolution is performed with the kernel centred on the respective field 3539 pixels. For directions in which the kernel has an odd size this holds 3540 precisely. For an even-sized kernel this means the kernel centre is placed 3541 0.5 pixel left or up (towards lower indices) from the respective field 3542 pixel. 3543 3544 See L{DataField.extend}() for what constitutes the exterior and how it is 3545 handled. 3546 3547 If B{C{as_integral}} is B{C{False}} the function performs a simple discrete 3548 convolution sum and the value units of B{C{target}} are set to product of B{C{field}} 3549 and B{C{kernel}} units. 3550 3551 If B{C{as_integral}} is B{C{True}} the function approximates a convolution integral. 3552 In this case B{C{kernel}} should be a sampled continuous transfer function. 3553 The units of value B{C{target}} are set to product of B{C{field}} and B{C{kernel}} value 3554 units and B{C{field}} lateral units squared. Furthermore, the discrete sum is 3555 multiplied by the pixel size (i.e. dB{C{x}} dB{C{y}} in the integral). 3556 3557 In either case, the lateral units and pixel size of B{C{kernel}} are assumed to 3558 be the same as for B{C{field}} (albeit not checked), because the convolution does 3559 not make sense otherwise. 3560 3561 @since: 2.49 3562 3563 @param col: Upper-left column coordinate. I{(int)} 3564 @param row: Upper-left row coordinate. I{(int)} 3565 @param width: Area width (number of columns). I{(int)} 3566 @param height: Area height (number of rows). I{(int)} 3567 @param target: A two-dimensional data field where the result will be placed. 3568 It may be B{C{field}} for an in-place modification. I{(L{DataField})} 3569 @param kernel: Kernel to convolve B{C{field}} with. I{(L{DataField})} 3570 @param exterior: Exterior pixels handling. Expected values: C{B{EXTERIOR_UNDEFINED}}, C{B{EXTERIOR_BORDER_EXTEND}}, C{B{EXTERIOR_MIRROR_EXTEND}}, C{B{EXTERIOR_PERIODIC}}, C{B{EXTERIOR_FIXED_VALUE}}. I{(L{ExteriorType})} 3571 @param fill_value: The value to use with B{C{EXTERIOR_FIXED_VALUE}} exterior. I{(float)} 3572 @param as_integral: B{C{True}} for normalisation and units as a convolution integral, 3573 B{C{False}} as a sum. I{(bool)} 3574 """ 3575 pass
3576
3577 - def convolve_1d(kernel_line, orientation):
3578 """ 3579 Convolves a data field with given linear kernel. 3580 3581 @since: 2.4 3582 3583 @param kernel_line: Kenrel line to convolve B{C{data_field}} with. I{(L{DataLine})} 3584 @param orientation: Filter orientation (see L{DataField.area_convolve_1d}()). Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3585 """ 3586 pass
3587
3588 - def area_convolve_1d(kernel_line, orientation, col, row, width, height):
3589 """ 3590 Convolves a rectangular part of a data field with given linear kernel. 3591 3592 For large separable kernels it can be more efficient to use a sequence of 3593 horizontal and vertical convolutions instead one 2D convolution. 3594 3595 @since: 2.4 3596 3597 @param kernel_line: Kernel line to convolve B{C{data_field}} with. I{(L{DataLine})} 3598 @param orientation: Filter orientation (B{C{ORIENTATION_HORIZONTAL}} for 3599 row-wise convolution, B{C{ORIENTATION_VERTICAL}} for 3600 column-wise convolution). Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3601 @param col: Upper-left column coordinate. I{(int)} 3602 @param row: Upper-left row coordinate. I{(int)} 3603 @param width: Area width (number of columns). I{(int)} 3604 @param height: Area height (number of rows). I{(int)} 3605 """ 3606 pass
3607
3608 - def area_ext_row_convolve(col, row, width, height, target, kernel, exterior, fill_value, as_integral):
3609 """ 3610 Convolve a field row-wise with a one-dimensional kernel. 3611 3612 Pixel dimensions of B{C{target}} may match either B{C{field}} or just the rectangular 3613 area. In the former case the result is written in the same rectangular 3614 area; in the latter case the result fills the entire B{C{target}}. 3615 3616 The convolution is performed with the kernel centred on the respective field 3617 pixels. For an odd-sized kernel this holds precisely. For an even-sized 3618 kernel this means the kernel centre is placed 0.5 pixel to the left 3619 (towards lower column indices) from the respective field pixel. 3620 3621 See L{DataField.extend}() for what constitutes the exterior and how it is 3622 handled. 3623 3624 If B{C{as_integral}} is B{C{False}} the function performs a simple discrete 3625 convolution sum and the value units of B{C{target}} are set to product of B{C{field}} 3626 and B{C{kernel}} units. 3627 3628 If B{C{as_integral}} is B{C{True}} the function approximates a convolution integral. 3629 In this case B{C{kernel}} should be a sampled continuous transfer function. 3630 The units of value B{C{target}} are set to product of B{C{field}} and B{C{kernel}} value 3631 units and B{C{field}} lateral units. Furthermore, the discrete sum is multiplied 3632 by the pixel size (i.e. dB{C{x}} in the integral). 3633 3634 In either case, the lateral units and pixel size of B{C{kernel}} are assumed to 3635 be the same as for a B{C{field}}'s row (albeit not checked), because 3636 the convolution does not make sense otherwise. 3637 3638 @since: 2.49 3639 3640 @param col: Upper-left column coordinate. I{(int)} 3641 @param row: Upper-left row coordinate. I{(int)} 3642 @param width: Area width (number of columns). I{(int)} 3643 @param height: Area height (number of rows). I{(int)} 3644 @param target: A two-dimensional data field where the result will be placed. 3645 It may be B{C{field}} for an in-place modification. I{(L{DataField})} 3646 @param kernel: Kernel to convolve B{C{field}} with. I{(L{DataLine})} 3647 @param exterior: Exterior pixels handling. Expected values: C{B{EXTERIOR_UNDEFINED}}, C{B{EXTERIOR_BORDER_EXTEND}}, C{B{EXTERIOR_MIRROR_EXTEND}}, C{B{EXTERIOR_PERIODIC}}, C{B{EXTERIOR_FIXED_VALUE}}. I{(L{ExteriorType})} 3648 @param fill_value: The value to use with B{C{EXTERIOR_FIXED_VALUE}} exterior. I{(float)} 3649 @param as_integral: B{C{True}} for normalisation and units as a convolution integral, 3650 B{C{False}} as a sum. I{(bool)} 3651 """ 3652 pass
3653
3654 - def filter_median(size):
3655 """ 3656 Filters a data field with median filter. 3657 3658 @param size: Size of area to take median of. I{(int)} 3659 """ 3660 pass
3661
3662 - def area_filter_median(size, col, row, width, height):
3663 """ 3664 Filters a rectangular part of a data field with median filter. 3665 3666 @param size: Size of area to take median of. I{(int)} 3667 @param col: Upper-left column coordinate. I{(int)} 3668 @param row: Upper-left row coordinate. I{(int)} 3669 @param width: Area width (number of columns). I{(int)} 3670 @param height: Area height (number of rows). I{(int)} 3671 """ 3672 pass
3673
3674 - def filter_mean(size):
3675 """ 3676 Filters a data field with mean filter of size B{C{size}}. 3677 3678 @param size: Averaged area size. I{(int)} 3679 """ 3680 pass
3681
3682 - def area_filter_mean(size, col, row, width, height):
3683 """ 3684 Filters a rectangular part of a data field with mean filter of size B{C{size}}. 3685 3686 This method is a simple L{DataField.area_gather}() wrapper. 3687 3688 @param size: Averaged area size. I{(int)} 3689 @param col: Upper-left column coordinate. I{(int)} 3690 @param row: Upper-left row coordinate. I{(int)} 3691 @param width: Area width (number of columns). I{(int)} 3692 @param height: Area height (number of rows). I{(int)} 3693 """ 3694 pass
3695
3696 - def filter_conservative(size):
3697 """ 3698 Filters a data field with conservative denoise filter. 3699 3700 @param size: Filtered area size. I{(int)} 3701 """ 3702 pass
3703
3704 - def area_filter_conservative(size, col, row, width, height):
3705 """ 3706 Filters a rectangular part of a data field with conservative denoise filter. 3707 3708 @param size: Filtered area size. I{(int)} 3709 @param col: Upper-left column coordinate. I{(int)} 3710 @param row: Upper-left row coordinate. I{(int)} 3711 @param width: Area width (number of columns). I{(int)} 3712 @param height: Area height (number of rows). I{(int)} 3713 """ 3714 pass
3715
3716 - def filter_laplacian():
3717 """ 3718 Filters a data field with Laplacian filter. 3719 3720 """ 3721 pass
3722
3723 - def area_filter_laplacian(col, row, width, height):
3724 """ 3725 Filters a rectangular part of a data field with Laplacian filter. 3726 3727 @param col: Upper-left column coordinate. I{(int)} 3728 @param row: Upper-left row coordinate. I{(int)} 3729 @param width: Area width (number of columns). I{(int)} 3730 @param height: Area height (number of rows). I{(int)} 3731 """ 3732 pass
3733
3735 """ 3736 Filters a data field with Laplacian of Gaussians filter. 3737 3738 @since: 2.23 3739 3740 """ 3741 pass
3742
3743 - def area_filter_laplacian_of_gaussians(col, row, width, height):
3744 """ 3745 Filters a rectangular part of a data field 3746 with Laplacian of Gaussians filter. 3747 3748 @since: 2.23 3749 3750 @param col: Upper-left column coordinate. I{(int)} 3751 @param row: Upper-left row coordinate. I{(int)} 3752 @param width: Area width (number of columns). I{(int)} 3753 @param height: Area height (number of rows). I{(int)} 3754 """ 3755 pass
3756
3757 - def filter_sobel(orientation):
3758 """ 3759 Filters a data field with a directional Sobel filter. 3760 3761 @param orientation: Filter orientation. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3762 """ 3763 pass
3764
3765 - def area_filter_sobel(orientation, col, row, width, height):
3766 """ 3767 Filters a rectangular part of a data field with a directional Sobel filter. 3768 3769 @param orientation: Filter orientation. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3770 @param col: Upper-left column coordinate. I{(int)} 3771 @param row: Upper-left row coordinate. I{(int)} 3772 @param width: Area width (number of columns). I{(int)} 3773 @param height: Area height (number of rows). I{(int)} 3774 """ 3775 pass
3776
3777 - def filter_sobel_total():
3778 """ 3779 Filters a data field with total Sobel filter. 3780 3781 @since: 2.31 3782 3783 """ 3784 pass
3785
3786 - def filter_prewitt(orientation):
3787 """ 3788 Filters a data field with Prewitt filter. 3789 3790 @param orientation: Filter orientation. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3791 """ 3792 pass
3793
3794 - def area_filter_prewitt(orientation, col, row, width, height):
3795 """ 3796 Filters a rectangular part of a data field with a directional Prewitt 3797 filter. 3798 3799 @param orientation: Filter orientation. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3800 @param col: Upper-left column coordinate. I{(int)} 3801 @param row: Upper-left row coordinate. I{(int)} 3802 @param width: Area width (number of columns). I{(int)} 3803 @param height: Area height (number of rows). I{(int)} 3804 """ 3805 pass
3806
3807 - def filter_prewitt_total():
3808 """ 3809 Filters a data field with total Prewitt filter. 3810 3811 @since: 2.31 3812 3813 """ 3814 pass
3815
3816 - def filter_slope(xder, yder):
3817 """ 3818 Calculates x and y derivaties for an entire field. 3819 3820 The derivatives are calculated as the simple symmetrical differences (in 3821 physical units, not pixel-wise), except at the edges where the differences 3822 are one-sided. 3823 3824 @since: 2.37 3825 3826 @param xder: Data field where the x-derivarive is to be stored, or B{C{None}} if you 3827 are only interested in the y-derivarive. I{(L{DataField})} 3828 @param yder: Data field where the y-derivarive is to be stored, or B{C{None}} if you 3829 are only interested in the x-derivarive. I{(L{DataField})} 3830 """ 3831 pass
3832
3833 - def filter_dechecker():
3834 """ 3835 Filters a data field with 5x5 checker pattern removal filter. 3836 3837 @since: 2.1 3838 3839 """ 3840 pass
3841
3842 - def area_filter_dechecker(col, row, width, height):
3843 """ 3844 Filters a rectangular part of a data field with 5x5 checker pattern removal 3845 filter. 3846 3847 @since: 2.1 3848 3849 @param col: Upper-left column coordinate. I{(int)} 3850 @param row: Upper-left row coordinate. I{(int)} 3851 @param width: Area width (number of columns). I{(int)} 3852 @param height: Area height (number of rows). I{(int)} 3853 """ 3854 pass
3855
3856 - def filter_gaussian(sigma):
3857 """ 3858 Filters a data field with a Gaussian filter. 3859 3860 @since: 2.4 3861 3862 @param sigma: The sigma parameter of the Gaussian. I{(float)} 3863 """ 3864 pass
3865
3866 - def area_filter_gaussian(sigma, col, row, width, height):
3867 """ 3868 Filters a rectangular part of a data field with a Gaussian filter. 3869 3870 The Gausian is normalized, i.e. it is sum-preserving. 3871 3872 @since: 2.4 3873 3874 @param sigma: The sigma parameter of the Gaussian. I{(float)} 3875 @param col: Upper-left column coordinate. I{(int)} 3876 @param row: Upper-left row coordinate. I{(int)} 3877 @param width: Area width (number of columns). I{(int)} 3878 @param height: Area height (number of rows). I{(int)} 3879 """ 3880 pass
3881
3882 - def filter_minimum(size):
3883 """ 3884 Filters a data field with minimum filter. 3885 3886 @param size: Neighbourhood size for minimum search. I{(int)} 3887 """ 3888 pass
3889
3890 - def area_filter_minimum(size, col, row, width, height):
3891 """ 3892 Filters a rectangular part of a data field with minimum filter. 3893 3894 This operation is often called erosion filter. 3895 3896 @param size: Neighbourhood size for minimum search. I{(int)} 3897 @param col: Upper-left column coordinate. I{(int)} 3898 @param row: Upper-left row coordinate. I{(int)} 3899 @param width: Area width (number of columns). I{(int)} 3900 @param height: Area height (number of rows). I{(int)} 3901 """ 3902 pass
3903
3904 - def filter_maximum(size):
3905 """ 3906 Filters a data field with maximum filter. 3907 3908 @param size: Neighbourhood size for maximum search. I{(int)} 3909 """ 3910 pass
3911
3912 - def area_filter_maximum(size, col, row, width, height):
3913 """ 3914 Filters a rectangular part of a data field with maximum filter. 3915 3916 This operation is often called dilation filter. 3917 3918 @param size: Neighbourhood size for maximum search. I{(int)} 3919 @param col: Upper-left column coordinate. I{(int)} 3920 @param row: Upper-left row coordinate. I{(int)} 3921 @param width: Area width (number of columns). I{(int)} 3922 @param height: Area height (number of rows). I{(int)} 3923 """ 3924 pass
3925
3926 - def area_filter_min_max(kernel, filtertype, col, row, width, height):
3927 """ 3928 Applies a morphological operation with a flat structuring element to a 3929 part of a data field. 3930 3931 Morphological operations with flat structuring elements can be expressed 3932 using minimum (erosion) and maximum (dilation) filters that are the basic 3933 operations this function can perform. 3934 3935 The kernel field is a mask that defines the shape of the flat structuring 3936 element. It is reflected for all maximum operations (dilation). For 3937 symmetrical kernels this does not matter. You can use 3938 L{DataField.elliptic_area_fill}() to create a true circular (or 3939 elliptical) kernel. 3940 3941 The kernel is implicitly centered, i.e. it will be applied symmetrically to 3942 avoid unexpected data movement. Even-sized kernels (generally not 3943 recommended) will extend farther towards the top left image corner for 3944 minimum (erosion) and towards the bottom right corner for maximum (dilation) 3945 operations due to the reflection. If you need off-center structuring 3946 elements you can add empty rows or columns to one side of the kernel to 3947 counteract the symmetrisation. 3948 3949 The operation is linear-time in kernel size for any convex kernel. Note 3950 L{DataField.area_filter_minimum}() and 3951 L{DataField.area_filter_maximum}(), which are limited to square 3952 structuring elements, are much faster for large sizes of the squares. 3953 3954 The exterior is always handled as B{C{EXTERIOR_BORDER_EXTEND}}. 3955 3956 @since: 2.43 3957 3958 @param kernel: Data field defining the flat structuring element. I{(L{DataField})} 3959 @param filtertype: The type of filter to apply. Expected values: C{B{MIN_MAX_FILTER_MINIMUM}}, C{B{MIN_MAX_FILTER_EROSION}}, C{B{MIN_MAX_FILTER_MAXIMUM}}, C{B{MIN_MAX_FILTER_DILATION}}, C{B{MIN_MAX_FILTER_OPENING}}, C{B{MIN_MAX_FILTER_CLOSING}}, C{B{MIN_MAX_FILTER_RANGE}}, C{B{MIN_MAX_FILTER_NORMALIZATION}}. I{(L{MinMaxFilterType})} 3960 @param col: Upper-left column coordinate. I{(int)} 3961 @param row: Upper-left row coordinate. I{(int)} 3962 @param width: Area width (number of columns). I{(int)} 3963 @param height: Area height (number of rows). I{(int)} 3964 """ 3965 pass
3966
3967 - def area_filter_disc_asf(radius, closing, col, row, width, height):
3968 """ 3969 Applies an alternating sequential morphological filter with a flat disc 3970 structuring element to a part of a data field. 3971 3972 Alternating sequential filter is a filter consisting of repeated opening and 3973 closing (or closing and opening) with progressively larger structuring 3974 elements. This function performs such filtering for sequence of structuring 3975 elements consisting of true Euclidean discs with increasing radii. The 3976 largest disc in the sequence fits into a (2B{C{size}} + 1) × (2B{C{size}} + 1) square. 3977 3978 @since: 2.43 3979 3980 @param radius: Maximum radius of the circular structuring element, in pixels. 3981 For radius 0 and smaller the filter is no-op. I{(int)} 3982 @param closing: B{C{True}} requests an opening-closing filter (i.e. ending with 3983 closing), B{C{False}} requests a closing-opening filter (i.e. ending 3984 with opening). I{(bool)} 3985 @param col: Upper-left column coordinate. I{(int)} 3986 @param row: Upper-left row coordinate. I{(int)} 3987 @param width: Area width (number of columns). I{(int)} 3988 @param height: Area height (number of rows). I{(int)} 3989 """ 3990 pass
3991
3992 - def filter_rms(size):
3993 """ 3994 Filters a data field with RMS filter. 3995 3996 @param size: Area size. I{(int)} 3997 """ 3998 pass
3999
4000 - def area_filter_rms(size, col, row, width, height):
4001 """ 4002 Filters a rectangular part of a data field with RMS filter of size B{C{size}}. 4003 4004 RMS filter computes root mean square in given area. 4005 4006 @param size: Area size. I{(int)} 4007 @param col: Upper-left column coordinate. I{(int)} 4008 @param row: Upper-left row coordinate. I{(int)} 4009 @param width: Area width (number of columns). I{(int)} 4010 @param height: Area height (number of rows). I{(int)} 4011 """ 4012 pass
4013
4014 - def filter_kuwahara():
4015 """ 4016 Filters a data field with Kuwahara filter. 4017 4018 """ 4019 pass
4020
4021 - def area_filter_kuwahara(col, row, width, height):
4022 """ 4023 Filters a rectangular part of a data field with a Kuwahara 4024 (edge-preserving smoothing) filter. 4025 4026 @param col: Upper-left column coordinate. I{(int)} 4027 @param row: Upper-left row coordinate. I{(int)} 4028 @param width: Area width (number of columns). I{(int)} 4029 @param height: Area height (number of rows). I{(int)} 4030 """ 4031 pass
4032
4033 - def filter_canny(threshold):
4034 """ 4035 Filters a rectangular part of a data field with canny edge detector filter. 4036 4037 @param threshold: Slope detection threshold (range 0..1). I{(float)} 4038 """ 4039 pass
4040
4041 - def shade(target_field, theta, phi):
4042 """ 4043 Shades a data field. 4044 4045 @param target_field: A data field to put the shade to. It will be resized to 4046 match B{C{data_field}}. I{(L{DataField})} 4047 @param theta: Shading angle (in radians, from north pole). I{(float)} 4048 @param phi: Shade orientation in xy plane (in radians, counterclockwise). I{(float)} 4049 """ 4050 pass
4051
4052 - def filter_harris(y_gradient, result, neighbourhood, alpha):
4053 """ 4054 Applies Harris corner detection filter to a pair of gradient data fields. 4055 4056 All passed data field must have the same size. 4057 4058 @param y_gradient: Data field with pre-calculated vertical derivative. I{(L{DataField})} 4059 @param result: Data field for the result. I{(L{DataField})} 4060 @param neighbourhood: Neighbourhood size. I{(int)} 4061 @param alpha: Sensitivity paramter (the squared trace is multiplied by it). I{(float)} 4062 """ 4063 pass
4064
4065 - def fractal_partitioning(xresult, yresult, interpolation):
4066 """ 4067 Computes data for log-log plot by partitioning. 4068 4069 Data lines B{C{xresult}} and B{C{yresult}} will be resized to the output size and 4070 they will contain corresponding values at each position. 4071 4072 @param xresult: Data line to store x-values for log-log plot to. I{(L{DataLine})} 4073 @param yresult: Data line to store y-values for log-log plot to. I{(L{DataLine})} 4074 @param interpolation: Interpolation type. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4075 """ 4076 pass
4077
4078 - def fractal_cubecounting(xresult, yresult, interpolation):
4079 """ 4080 Computes data for log-log plot by cube counting. 4081 4082 Data lines B{C{xresult}} and B{C{yresult}} will be resized to the output size and 4083 they will contain corresponding values at each position. 4084 4085 @param xresult: Data line to store x-values for log-log plot to. I{(L{DataLine})} 4086 @param yresult: Data line to store y-values for log-log plot to. I{(L{DataLine})} 4087 @param interpolation: Interpolation type. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4088 """ 4089 pass
4090
4091 - def fractal_triangulation(xresult, yresult, interpolation):
4092 """ 4093 Computes data for log-log plot by triangulation. 4094 4095 Data lines B{C{xresult}} and B{C{yresult}} will be resized to the output size and 4096 they will contain corresponding values at each position. 4097 4098 @param xresult: Data line to store x-values for log-log plot to. I{(L{DataLine})} 4099 @param yresult: Data line to store y-values for log-log plot to. I{(L{DataLine})} 4100 @param interpolation: Interpolation type. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4101 """ 4102 pass
4103
4104 - def fractal_psdf(xresult, yresult, interpolation):
4105 """ 4106 Computes data for log-log plot by spectral density method. 4107 4108 Data lines B{C{xresult}} and B{C{yresult}} will be resized to the output size and 4109 they will contain corresponding values at each position. 4110 4111 @param xresult: Data line to store x-values for log-log plot to. I{(L{DataLine})} 4112 @param yresult: Data line to store y-values for log-log plot to. I{(L{DataLine})} 4113 @param interpolation: Interpolation type. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4114 """ 4115 pass
4116
4117 - def fractal_correction(mask_field, interpolation):
4118 """ 4119 Replaces data under mask with interpolated values using fractal 4120 interpolation. 4121 4122 @param mask_field: Mask of places to be corrected. I{(L{DataField})} 4123 @param interpolation: Interpolation type. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4124 """ 4125 pass
4126
4127 - def grains_mark_curvature(grain_field, threshval, below):
4128 """ 4129 Marks data that are above/below curvature threshold. 4130 4131 @param grain_field: Data field to store the resulting mask to. I{(L{DataField})} 4132 @param threshval: Relative curvature threshold, in percents. I{(float)} 4133 @param below: If B{C{True}}, data below threshold are marked, otherwise data above 4134 threshold are marked. I{(bool)} 4135 """ 4136 pass
4137
4138 - def grains_mark_watershed(grain_field, locate_steps, locate_thresh, locate_dropsize, wshed_steps, wshed_dropsize, prefilter, below):
4139 """ 4140 Performs watershed algorithm. 4141 4142 @param grain_field: Result of marking (mask). I{(L{DataField})} 4143 @param locate_steps: Locating algorithm steps. I{(int)} 4144 @param locate_thresh: Locating algorithm threshold. I{(int)} 4145 @param locate_dropsize: Locating drop size. I{(float)} 4146 @param wshed_steps: Watershed steps. I{(int)} 4147 @param wshed_dropsize: Watershed drop size. I{(float)} 4148 @param prefilter: Use prefiltering. I{(bool)} 4149 @param below: If B{C{True}}, valleys are marked, otherwise mountains are marked. I{(bool)} 4150 """ 4151 pass
4152
4153 - def grains_remove_grain(col, row):
4154 """ 4155 Removes one grain at given position. 4156 4157 4158 @param col: Column inside a grain. I{(int)} 4159 @param row: Row inside a grain. I{(int)} 4160 @return: B{C{True}} if a grain was actually removed (i.e., (B{C{col}},B{C{row}}) was 4161 inside a grain). I{(bool)} 4162 """ 4163 return None
4164
4165 - def grains_extract_grain(col, row):
4166 """ 4167 Removes all grains except that one at given position. 4168 4169 If there is no grain at (B{C{col}}, B{C{row}}), all grains are removed. 4170 4171 4172 @param col: Column inside a grain. I{(int)} 4173 @param row: Row inside a grain. I{(int)} 4174 @return: B{C{True}} if a grain remained (i.e., (B{C{col}},B{C{row}}) was inside a grain). I{(bool)} 4175 """ 4176 return None
4177
4178 - def grains_remove_by_number(number):
4179 """ 4180 Removes grain identified by B{C{number}}. 4181 4182 @since: 2.35 4183 4184 @param number: Grain number was filled by L{DataField.number_grains}(). I{(int)} 4185 """ 4186 pass
4187
4188 - def grains_remove_by_size(size):
4189 """ 4190 Removes all grains below specified area. 4191 4192 @param size: Grain area threshold, in square pixels. I{(int)} 4193 """ 4194 pass
4195
4196 - def grains_remove_by_height(grain_field, threshval, below):
4197 """ 4198 Removes grains that are higher/lower than given threshold value. 4199 4200 @param grain_field: Field of marked grains (mask) I{(L{DataField})} 4201 @param threshval: Relative height threshold, in percents. I{(float)} 4202 @param below: If B{C{True}}, grains below threshold are removed, otherwise grains above 4203 threshold are removed. I{(bool)} 4204 """ 4205 pass
4206
4208 """ 4209 Removes all grains that touch field borders. 4210 4211 @since: 2.30 4212 4213 """ 4214 pass
4215
4216 - def grains_watershed_init(grain_field, locate_steps, locate_thresh, locate_dropsize, wshed_steps, wshed_dropsize, prefilter, below):
4217 """ 4218 Initializes the watershed algorithm. 4219 4220 This iterator reports its state as B{C{WatershedStateType}}. 4221 4222 4223 @param grain_field: Result of marking (mask). I{(L{DataField})} 4224 @param locate_steps: Locating algorithm steps. I{(int)} 4225 @param locate_thresh: Locating algorithm threshold. I{(int)} 4226 @param locate_dropsize: Locating drop size. I{(float)} 4227 @param wshed_steps: Watershed steps. I{(int)} 4228 @param wshed_dropsize: Watershed drop size. I{(float)} 4229 @param prefilter: Use prefiltering. I{(bool)} 4230 @param below: If B{C{True}}, valleys are marked, otherwise mountains are marked. I{(bool)} 4231 @return: A new watershed iterator. I{(ComputationState*)} 4232 """ 4233 return None
4234
4235 - def grains_mark_height(grain_field, threshval, below):
4236 """ 4237 Marks data that are above/below height threshold. 4238 4239 @param grain_field: Data field to store the resulting mask to. I{(L{DataField})} 4240 @param threshval: Relative height threshold, in percents. I{(float)} 4241 @param below: If B{C{True}}, data below threshold are marked, otherwise data above 4242 threshold are marked. I{(bool)} 4243 """ 4244 pass
4245
4246 - def grains_mark_slope(grain_field, threshval, below):
4247 """ 4248 Marks data that are above/below slope threshold. 4249 4250 @param grain_field: Data field to store the resulting mask to. I{(L{DataField})} 4251 @param threshval: Relative slope threshold, in percents. I{(float)} 4252 @param below: If B{C{True}}, data below threshold are marked, otherwise data above 4253 threshold are marked. I{(bool)} 4254 """ 4255 pass
4256
4257 - def otsu_threshold():
4258 """ 4259 Finds Otsu's height threshold for a data field. 4260 4261 The Otsu's threshold is optimal in the sense that it minimises the 4262 inter-class variances of two classes of pixels: above and below theshold. 4263 4264 @since: 2.37 4265 4266 @return: I{(float)} 4267 """ 4268 return None
4269
4270 - def grains_add(add_field):
4271 """ 4272 Adds B{C{add_field}} grains to B{C{grain_field}}. 4273 4274 Note: This function is equivalent to 4275 |[ 4276 L{DataField.max_of_fields}(grain_field, grain_field, add_field); 4277 ]| 4278 4279 @param add_field: Field of marked grains (mask) to be added. I{(L{DataField})} 4280 """ 4281 pass
4282
4283 - def grains_intersect(intersect_field):
4284 """ 4285 Performs intersection betweet two grain fields, 4286 result is stored in B{C{grain_field}}. 4287 4288 Note: This function is equivalent to 4289 |[ 4290 L{DataField.min_of_fields}(grain_field, grain_field, intersect_field); 4291 ]| 4292 4293 @param intersect_field: Field of marked grains (mask). I{(L{DataField})} 4294 """ 4295 pass
4296
4297 - def grains_invert():
4298 """ 4299 Inverts a data field representing a mask. 4300 4301 All non-positive values are transformed to 1.0. All positive values are 4302 transformed to 0.0. 4303 4304 @since: 2.43 4305 4306 """ 4307 pass
4308
4309 - def grains_autocrop(symmetrically):
4310 """ 4311 Removes empty border rows and columns from a data field representing a mask. 4312 4313 If there are border rows and columns filled completely with non-positive 4314 values the size of the data field is reduced, removing these rows. The 4315 parameter B{C{symmetrically}} controls whether the size reduction is maximum 4316 possible or symmetrical. 4317 4318 When there is no positive value in the field the field size is reduced to 4319 the smallest possible. This means 1x1 for B{C{symmetrical}} being B{C{False}} and 4320 even original dimensions to 2 for B{C{symmetrical}} being B{C{True}}. 4321 4322 @since: 2.43 4323 4324 @param symmetrically: B{C{True}} to remove borders symmetrically, i.e the same number 4325 of pixels from left and right, and also top and bottom. 4326 B{C{False}} to remove as many empty rows and columns as possible. I{(bool)} 4327 @return: Tuple consisting of 5 values (B{C{value}}, B{C{left}}, B{C{right}}, B{C{up}}, B{C{down}}). (I{(bool)}, I{(int)}, I{(int)}, I{(int)}, I{(int)}) 4328 """ 4329 return None, None, None, None, None
4330
4331 - def area_grains_tgnd(target_line, col, row, width, height, below, nstats):
4332 """ 4333 Calculates threshold grain number distribution. 4334 4335 This function is a simple L{DataField.area_grains_tgnd_range}() that 4336 calculates the distribution in the full range. 4337 4338 @param target_line: A data line to store the distribution to. It will be 4339 resampled to the requested width. I{(L{DataLine})} 4340 @param col: Upper-left column coordinate. I{(int)} 4341 @param row: Upper-left row coordinate. I{(int)} 4342 @param width: Area width (number of columns). I{(int)} 4343 @param height: Area height (number of rows). I{(int)} 4344 @param below: If B{C{True}}, valleys are marked, otherwise mountains are marked. I{(bool)} 4345 @param nstats: The number of samples to take on the distribution function. If 4346 nonpositive, a suitable resolution is determined automatically. I{(int)} 4347 """ 4348 pass
4349
4350 - def area_grains_tgnd_range(target_line, col, row, width, height, min, max, below, nstats):
4351 """ 4352 Calculates threshold grain number distribution in given height range. 4353 4354 This is the number of grains for each of B{C{nstats}} equidistant height 4355 threshold levels. For large B{C{nstats}} this function is much faster than the 4356 equivalent number of L{DataField.grains_mark_height}() calls. 4357 4358 @param target_line: A data line to store the distribution to. It will be 4359 resampled to the requested width. I{(L{DataLine})} 4360 @param col: Upper-left column coordinate. I{(int)} 4361 @param row: Upper-left row coordinate. I{(int)} 4362 @param width: Area width (number of columns). I{(int)} 4363 @param height: Area height (number of rows). I{(int)} 4364 @param min: Minimum threshold value. I{(float)} 4365 @param max: Maximum threshold value. I{(float)} 4366 @param below: If B{C{True}}, valleys are marked, otherwise mountains are marked. I{(bool)} 4367 @param nstats: The number of samples to take on the distribution function. If 4368 nonpositive, a suitable resolution is determined automatically. I{(int)} 4369 """ 4370 pass
4371
4372 - def grains_splash_water(minima, locate_steps, locate_dropsize):
4373 pass
4374
4376 """ 4377 Performs Euclidean distance transform of a data field with grains. 4378 4379 Each non-zero value will be replaced with Euclidean distance to the grain 4380 boundary, measured in pixels. 4381 4382 See also L{DataField.grain_simple_dist_trans}() for simple distance 4383 transforms such as city-block or chessboard. 4384 4385 @since: 2.36 4386 4387 """ 4388 pass
4389
4390 - def grain_simple_dist_trans(dtype, from_border):
4391 """ 4392 Performs a distance transform of a data field with grains. 4393 4394 Each non-zero value will be replaced with a distance to the grain boundary, 4395 measured in pixels. 4396 4397 Note this function can calculate the true Euclidean distance transform 4398 only since 2.43. Use L{DataField.grain_distance_transform}() for the EDT 4399 if you need compatibility with older versions. 4400 4401 @since: 2.41 4402 4403 @param dtype: Type of simple distance to use. Expected values: C{B{DISTANCE_TRANSFORM_CITYBLOCK}}, C{B{DISTANCE_TRANSFORM_CONN4}}, C{B{DISTANCE_TRANSFORM_CHESS}}, C{B{DISTANCE_TRANSFORM_CONN8}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL48}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL84}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL}}, C{B{DISTANCE_TRANSFORM_EUCLIDEAN}}. I{(L{DistanceTransformType})} 4404 @param from_border: B{C{True}} to consider image edges to be grain boundaries. I{(bool)} 4405 """ 4406 pass
4407
4408 - def grains_shrink(amount, dtype, from_border):
4409 """ 4410 Erodes a data field containing mask by specified amount using a distance 4411 measure. 4412 4413 Non-zero pixels in B{C{data_field}} will be replaced with zeroes if they are not 4414 farther than B{C{amount}} from the grain boundary as defined by B{C{dtype}}. 4415 4416 @since: 2.43 4417 4418 @param amount: How much the grains should be reduced, in pixels. It is inclusive, 4419 i.e. pixels that are B{C{amount}} far from the border will be removed. I{(float)} 4420 @param dtype: Type of simple distance to use. Expected values: C{B{DISTANCE_TRANSFORM_CITYBLOCK}}, C{B{DISTANCE_TRANSFORM_CONN4}}, C{B{DISTANCE_TRANSFORM_CHESS}}, C{B{DISTANCE_TRANSFORM_CONN8}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL48}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL84}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL}}, C{B{DISTANCE_TRANSFORM_EUCLIDEAN}}. I{(L{DistanceTransformType})} 4421 @param from_border: B{C{True}} to consider image edges to be grain boundaries. 4422 B{C{False}} to reduce grains touching field boundaries only along 4423 the boundaries. I{(bool)} 4424 """ 4425 pass
4426
4427 - def grains_grow(amount, dtype, prevent_merging):
4428 """ 4429 Dilates a data field containing mask by specified amount using a distance 4430 measure. 4431 4432 Non-positive pixels in B{C{data_field}} will be replaced with ones if they are 4433 not farther than B{C{amount}} from the grain boundary as defined by B{C{dtype}}. 4434 4435 @since: 2.43 4436 4437 @param amount: How much the grains should be expanded, in pixels. It is 4438 inclusive, i.e. exterior pixels that are B{C{amount}} far from the 4439 border will be filled. I{(float)} 4440 @param dtype: Type of simple distance to use. Expected values: C{B{DISTANCE_TRANSFORM_CITYBLOCK}}, C{B{DISTANCE_TRANSFORM_CONN4}}, C{B{DISTANCE_TRANSFORM_CHESS}}, C{B{DISTANCE_TRANSFORM_CONN8}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL48}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL84}}, C{B{DISTANCE_TRANSFORM_OCTAGONAL}}, C{B{DISTANCE_TRANSFORM_EUCLIDEAN}}. I{(L{DistanceTransformType})} 4441 @param prevent_merging: B{C{True}} to prevent grain merging, i.e. the growth stops 4442 where two grains would merge. B{C{False}} to simply expand the 4443 grains, without regard to grain connectivity. I{(bool)} 4444 """ 4445 pass
4446
4447 - def grains_thin():
4448 """ 4449 Performs thinning of a data field containing mask. 4450 4451 The result of thinning is a ‘skeleton’ mask consisting of single-pixel thin 4452 lines. 4453 4454 @since: 2.48 4455 4456 """ 4457 pass
4458
4459 - def fill_voids(nonsimple):
4460 """ 4461 Fills voids in grains in a data field representing a mask. 4462 4463 Voids in grains are zero pixels in B{C{data_field}} from which no path exists 4464 through other zero pixels to the field boundary. The paths are considered 4465 in 8-connectivity because grains themselves are considered in 4466 4-connectivity. 4467 4468 @since: 2.37 4469 4470 @param nonsimple: Pass B{C{True}} to fill also voids that are not simple-connected 4471 (e.g. ring-like). This can result in grain merging if a small 4472 grain is contained within a void. Pass B{C{False}} to fill only 4473 simple-connected grains. I{(bool)} 4474 @return: B{C{True}} if any voids were filled at all, B{C{False}} if no change was 4475 made. I{(bool)} 4476 """ 4477 return None
4478
4479 - def mark_extrema(extrema, maxima):
4480 """ 4481 Marks local maxima or minima in a two-dimensional field. 4482 4483 Local (or regional) maximum is a contiguous set of pixels that have the same 4484 value and this value is sharply greater than the value of any pixel touching 4485 the set. A minimum is defined analogously. A field filled with a single 4486 value is considered to have neither minimum nor maximum. 4487 4488 @since: 2.37 4489 4490 @param extrema: Target field for the extrema mask. I{(L{DataField})} 4491 @param maxima: B{C{True}} to mark maxima, B{C{False}} to mark minima. I{(bool)} 4492 """ 4493 pass
4494
4495 - def hough_line(x_gradient, y_gradient, result, hwidth, overlapping):
4496 pass
4497
4498 - def hough_circle(x_gradient, y_gradient, result, radius):
4499 pass
4500
4501 - def hough_line_strenghten(x_gradient, y_gradient, hwidth, threshold):
4502 pass
4503
4504 - def hough_circle_strenghten(x_gradient, y_gradient, radius, threshold):
4505 pass
4506
4507 - def hough_polar_line_to_datafield(rho, theta):
4508 return None, None, None, None
4509
4510 - def fft1d(iin, rout, iout, orientation, windowing, direction, interpolation, preserverms, level):
4511 """ 4512 Transforms all rows or columns in a data field with Fast Fourier Transform. 4513 4514 If requested a windowing and/or leveling is applied to preprocess data to 4515 obtain reasonable results. 4516 4517 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4518 transform which can be somewhat faster than complex-to-complex 4519 transform. I{(L{DataField})} 4520 @param rout: Real output data field, it will be resized to area size. I{(L{DataField})} 4521 @param iout: Imaginary output data field, it will be resized to area size. I{(L{DataField})} 4522 @param orientation: Orientation: pass B{C{ORIENTATION_HORIZONTAL}} to 4523 transform rows, B{C{ORIENTATION_VERTICAL}} to transform 4524 columns. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 4525 @param windowing: Windowing type. Expected values: C{B{WINDOWING_NONE}}, C{B{WINDOWING_HANN}}, C{B{WINDOWING_HAMMING}}, C{B{WINDOWING_BLACKMANN}}, C{B{WINDOWING_LANCZOS}}, C{B{WINDOWING_WELCH}}, C{B{WINDOWING_RECT}}, C{B{WINDOWING_NUTTALL}}, C{B{WINDOWING_FLAT_TOP}}, C{B{WINDOWING_KAISER25}}. I{(L{WindowingType})} 4526 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4527 @param interpolation: Interpolation type. 4528 Ignored since 2.8 as no resampling is performed. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4529 @param preserverms: B{C{True}} to preserve RMS while windowing. I{(bool)} 4530 @param level: 0 to perform no leveling, 1 to subtract mean value, 2 to subtract 4531 line (the number can be interpreted as the first polynomial degree 4532 to keep, but only the enumerated three values are available). I{(int)} 4533 """ 4534 pass
4535
4536 - def area_1dfft(iin, rout, iout, col, row, width, height, orientation, windowing, direction, interpolation, preserverms, level):
4537 """ 4538 Transforms all rows or columns in a rectangular part of a data field with 4539 Fast Fourier Transform. 4540 4541 If requested a windowing and/or leveling is applied to preprocess data to 4542 obtain reasonable results. 4543 4544 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4545 transform which can be somewhat faster than complex-to-complex 4546 transform. I{(L{DataField})} 4547 @param rout: Real output data field, it will be resized to area size. I{(L{DataField})} 4548 @param iout: Imaginary output data field, it will be resized to area size. I{(L{DataField})} 4549 @param col: Upper-left column coordinate. I{(int)} 4550 @param row: Upper-left row coordinate. I{(int)} 4551 @param width: Area width (number of columns), must be at least 2 for horizontal 4552 transforms. I{(int)} 4553 @param height: Area height (number of rows), must be at least 2 for vertical 4554 transforms. I{(int)} 4555 @param orientation: Orientation: pass B{C{ORIENTATION_HORIZONTAL}} to 4556 transform rows, B{C{ORIENTATION_VERTICAL}} to transform 4557 columns. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 4558 @param windowing: Windowing type. Expected values: C{B{WINDOWING_NONE}}, C{B{WINDOWING_HANN}}, C{B{WINDOWING_HAMMING}}, C{B{WINDOWING_BLACKMANN}}, C{B{WINDOWING_LANCZOS}}, C{B{WINDOWING_WELCH}}, C{B{WINDOWING_RECT}}, C{B{WINDOWING_NUTTALL}}, C{B{WINDOWING_FLAT_TOP}}, C{B{WINDOWING_KAISER25}}. I{(L{WindowingType})} 4559 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4560 @param interpolation: Interpolation type. 4561 Ignored since 2.8 as no resampling is performed. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4562 @param preserverms: B{C{True}} to preserve RMS while windowing. I{(bool)} 4563 @param level: 0 to perform no leveling, 1 to subtract mean value, 2 to subtract 4564 lines (the number can be interpreted as the first polynomial degree 4565 to keep, but only the enumerated three values are available). I{(int)} 4566 """ 4567 pass
4568
4569 - def fft1d_raw(iin, rout, iout, orientation, direction):
4570 """ 4571 Transforms all rows or columns in a data field with Fast Fourier Transform. 4572 4573 No leveling, windowing nor scaling is performed. 4574 4575 Since 2.8 the dimensions need not to be from the set of sizes returned 4576 by L{gwy_fft_find_nice_size}(). 4577 4578 @since: 2.1 4579 4580 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4581 transform. I{(L{DataField})} 4582 @param rout: Real output data field, it will be resized to B{C{rin}} size. I{(L{DataField})} 4583 @param iout: Imaginary output data field, it will be resized to B{C{rin}} size. I{(L{DataField})} 4584 @param orientation: Orientation: pass B{C{ORIENTATION_HORIZONTAL}} to 4585 transform rows, B{C{ORIENTATION_VERTICAL}} to transform 4586 columns. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 4587 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4588 """ 4589 pass
4590
4591 - def fft2d(iin, rout, iout, windowing, direction, interpolation, preserverms, level):
4592 """ 4593 Calculates 2D Fast Fourier Transform of a rectangular a data field. 4594 4595 If requested a windowing and/or leveling is applied to preprocess data to 4596 obtain reasonable results. 4597 4598 Lateral dimensions, offsets and units are unchanged. See 4599 L{DataField.fft_postprocess}() for that. 4600 4601 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4602 transform which can be somewhat faster than complex-to-complex 4603 transform. I{(L{DataField})} 4604 @param rout: Real output data field, it will be resized to area size. I{(L{DataField})} 4605 @param iout: Imaginary output data field, it will be resized to area size. I{(L{DataField})} 4606 @param windowing: Windowing type. Expected values: C{B{WINDOWING_NONE}}, C{B{WINDOWING_HANN}}, C{B{WINDOWING_HAMMING}}, C{B{WINDOWING_BLACKMANN}}, C{B{WINDOWING_LANCZOS}}, C{B{WINDOWING_WELCH}}, C{B{WINDOWING_RECT}}, C{B{WINDOWING_NUTTALL}}, C{B{WINDOWING_FLAT_TOP}}, C{B{WINDOWING_KAISER25}}. I{(L{WindowingType})} 4607 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4608 @param interpolation: Interpolation type. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4609 @param preserverms: B{C{True}} to preserve RMS while windowing. I{(bool)} 4610 @param level: 0 to perform no leveling, 1 to subtract mean value, 2 to subtract 4611 plane (the number can be interpreted as the first polynomial degree 4612 to keep, but only the enumerated three values are available). I{(int)} 4613 """ 4614 pass
4615
4616 - def area_2dfft(iin, rout, iout, col, row, width, height, windowing, direction, interpolation, preserverms, level):
4617 """ 4618 Calculates 2D Fast Fourier Transform of a rectangular area of a data field. 4619 4620 If requested a windowing and/or leveling is applied to preprocess data to 4621 obtain reasonable results. 4622 4623 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4624 transform which can be somewhat faster than complex-to-complex 4625 transform. I{(L{DataField})} 4626 @param rout: Real output data field, it will be resized to area size. I{(L{DataField})} 4627 @param iout: Imaginary output data field, it will be resized to area size. I{(L{DataField})} 4628 @param col: Upper-left column coordinate. I{(int)} 4629 @param row: Upper-left row coordinate. I{(int)} 4630 @param width: Area width (number of columns), must be at least 2. I{(int)} 4631 @param height: Area height (number of rows), must be at least 2. I{(int)} 4632 @param windowing: Windowing type. Expected values: C{B{WINDOWING_NONE}}, C{B{WINDOWING_HANN}}, C{B{WINDOWING_HAMMING}}, C{B{WINDOWING_BLACKMANN}}, C{B{WINDOWING_LANCZOS}}, C{B{WINDOWING_WELCH}}, C{B{WINDOWING_RECT}}, C{B{WINDOWING_NUTTALL}}, C{B{WINDOWING_FLAT_TOP}}, C{B{WINDOWING_KAISER25}}. I{(L{WindowingType})} 4633 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4634 @param interpolation: Interpolation type. 4635 Ignored since 2.8 as no resampling is performed. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4636 @param preserverms: B{C{True}} to preserve RMS while windowing. I{(bool)} 4637 @param level: 0 to perform no leveling, 1 to subtract mean value, 2 to subtract 4638 plane (the number can be interpreted as the first polynomial degree 4639 to keep, but only the enumerated three values are available). I{(int)} 4640 """ 4641 pass
4642
4643 - def fft2d_raw(iin, rout, iout, direction):
4644 """ 4645 Calculates 2D Fast Fourier Transform of a data field. 4646 4647 No leveling, windowing nor scaling is performed. 4648 4649 Since 2.8 the dimensions need not to be from the set of sizes returned 4650 by L{gwy_fft_find_nice_size}(). 4651 4652 Lateral dimensions, offsets and units are unchanged. See 4653 L{DataField.fft_postprocess}() for that. 4654 4655 @since: 2.1 4656 4657 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4658 transform. I{(L{DataField})} 4659 @param rout: Real output data field, it will be resized to B{C{rin}} size. I{(L{DataField})} 4660 @param iout: Imaginary output data field, it will be resized to B{C{rin}} size. I{(L{DataField})} 4661 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4662 """ 4663 pass
4664
4665 - def fft2d_humanize():
4666 """ 4667 Rearranges 2D FFT output to a human-friendly form. 4668 4669 Top-left, top-right, bottom-left and bottom-right sub-rectangles are swapped 4670 to obtain a humanized 2D FFT output with (0,0) in the centre. 4671 4672 More precisely, for even field dimensions the equally-sized blocks starting 4673 with the Nyquist frequency and with the zero frequency (constant component) 4674 will exchange places. For odd field dimensions, the block containing the 4675 zero frequency is one item larger and the constant component will actually 4676 end up in the exact centre. 4677 4678 Also note if both dimensions are even, this function is involutory and 4679 identical to L{DataField.fft2d_dehumanize}(). However, if any dimension 4680 is odd, L{DataField.fft2d_humanize}() and 4681 L{DataField.fft2d_dehumanize}() are different, therefore they must be 4682 paired properly. 4683 4684 """ 4685 pass
4686
4687 - def fft2d_dehumanize():
4688 """ 4689 Rearranges 2D FFT output back from the human-friendly form. 4690 4691 Top-left, top-right, bottom-left and bottom-right sub-rectangles are swapped 4692 to reshuffle a humanized 2D FFT output back into the natural positions. 4693 4694 See L{DataField.fft2d_humanize}() for discussion. 4695 4696 @since: 2.8 4697 4698 """ 4699 pass
4700
4701 - def fft_postprocess(humanize):
4702 """ 4703 Updates units, dimensions and offsets for a 2D FFT-processed field. 4704 4705 The field is expected to have dimensions and units of the original 4706 direct-space data. The lateral units and resolutions are updated to 4707 correspond to its Fourier transform. 4708 4709 If B{C{humanize}} is B{C{True}} L{DataField.fft2d_humanize}() is applied to the 4710 field data and the lateral offsets are set accordingly. Otherwise the 4711 offsets are cleared. 4712 4713 Value units are kept intact. 4714 4715 @since: 2.38 4716 4717 @param humanize: B{C{True}} to rearrange data to have the frequency origin in the 4718 centre. I{(bool)} 4719 """ 4720 pass
4721
4722 - def fft_filter_1d(result_field, weights, orientation, interpolation):
4723 """ 4724 Performs 1D FFT filtering of a data field. 4725 4726 @param result_field: A data field to store the result to. It will be resampled 4727 to B{C{data_field}}'s size. I{(L{DataField})} 4728 @param weights: Filter weights for the lower half of the spectrum (the other 4729 half is symmetric). Its size can be arbitrary, it will be 4730 interpolated. I{(L{DataLine})} 4731 @param orientation: Filter direction. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 4732 @param interpolation: The interpolation to use for resampling. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4733 """ 4734 pass
4735
4736 - def cwt(interpolation, scale, wtype):
4737 """ 4738 Computes a continuous wavelet transform (CWT) at given 4739 scale and using given wavelet. 4740 4741 @param interpolation: Interpolation type. 4742 Ignored since 2.8 as no resampling is performed. Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4743 @param scale: Wavelet scale. I{(float)} 4744 @param wtype: Wavelet type. Expected values: C{B{2DCWT_GAUSS}}, C{B{2DCWT_HAT}}. I{(L{2DCWTWaveletType})} 4745 """ 4746 pass
4747
4748 - def area_fit_plane(mask, col, row, width, height):
4749 """ 4750 Fits a plane through a rectangular part of a data field. 4751 4752 The coefficients can be used for plane leveling using the same relation 4753 as in L{DataField.fit_plane}(), counting indices from area top left 4754 corner. 4755 4756 @param mask: Mask of values to take values into account, or B{C{None}} for full 4757 B{C{data_field}}. Values equal to 0.0 and below cause corresponding 4758 B{C{data_field}} samples to be ignored, values equal to 1.0 and above 4759 cause inclusion of corresponding B{C{data_field}} samples. The behaviour 4760 for values inside (0.0, 1.0) is undefined (it may be specified 4761 in the future). I{(L{DataField})} 4762 @param col: Upper-left column coordinate. I{(int)} 4763 @param row: Upper-left row coordinate. I{(int)} 4764 @param width: Area width (number of columns). I{(int)} 4765 @param height: Area height (number of rows). I{(int)} 4766 @return: Tuple consisting of 3 values (B{C{pa}}, B{C{pbx}}, B{C{pby}}). (I{(float)}, I{(float)}, I{(float)}) 4767 """ 4768 return None, None, None
4769
4770 - def fit_plane():
4771 """ 4772 Fits a plane through a data field. 4773 4774 The coefficients can be used for plane leveling using relation 4775 data[i] := data[i] - (pa + pby*i + pbx*j); 4776 4777 @return: Tuple consisting of 3 values (B{C{pa}}, B{C{pbx}}, B{C{pby}}). (I{(float)}, I{(float)}, I{(float)}) 4778 """ 4779 return None, None, None
4780
4781 - def fit_facet_plane(mfield, masking):
4782 """ 4783 Calculates the inclination of a plane close to the dominant plane in a data 4784 field. 4785 4786 The dominant plane is determined by taking into account larger local slopes 4787 with exponentially smaller weight. 4788 4789 This is the basis of so-called facet levelling algorithm. Usually, the 4790 plane found by this method is subtracted using L{DataField.plane_level}() 4791 and the entire process is repeated until it converges. A convergence 4792 criterion may be sufficiently small values of the x and y plane 4793 coefficients. Note that since L{DataField.plane_level}() uses pixel-based 4794 lateral coordinates, the coefficients must be divided by 4795 L{DataField.get_xmeasure}(data_field) and 4796 L{DataField.get_ymeasure}(data_field) to obtain physical plane 4797 coefficients. 4798 4799 @since: 2.37 4800 4801 @param mfield: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 4802 @param masking: Masking mode to use. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 4803 @return: Tuple consisting of 4 values (B{C{value}}, B{C{pa}}, B{C{pbx}}, B{C{pby}}). (I{(bool)}, I{(float)}, I{(float)}, I{(float)}) 4804 """ 4805 return None, None, None, None
4806
4807 - def plane_level(a, bx, by):
4808 """ 4809 Subtracts plane from a data field. 4810 4811 See L{DataField.fit_plane}() for details. 4812 4813 @param a: Constant coefficient. I{(float)} 4814 @param bx: X plane coefficient. I{(float)} 4815 @param by: Y plane coefficient. I{(float)} 4816 """ 4817 pass
4818
4819 - def plane_rotate(xangle, yangle, interpolation):
4820 """ 4821 Performs rotation of plane along x and y axis. 4822 4823 @param xangle: Rotation angle in x direction (rotation along y axis, in radians). I{(float)} 4824 @param yangle: Rotation angle in y direction (rotation along x axis, in radians). I{(float)} 4825 @param interpolation: Interpolation type (can be only of two-point type). Expected values: C{B{INTERPOLATION_NONE}}, C{B{INTERPOLATION_ROUND}}, C{B{INTERPOLATION_LINEAR}}, C{B{INTERPOLATION_BILINEAR}}, C{B{INTERPOLATION_KEY}}, C{B{INTERPOLATION_BSPLINE}}, C{B{INTERPOLATION_OMOMS}}, C{B{INTERPOLATION_NNA}}, C{B{INTERPOLATION_SCHAUM}}. I{(L{InterpolationType})} 4826 """ 4827 pass
4828
4829 - def fit_lines(col, row, width, height, degree, exclude, orientation):
4830 """ 4831 Independently levels profiles on each row/column in a data field. 4832 4833 Lines that have no intersection with area selected by B{C{ulcol}}, B{C{ulrow}}, 4834 B{C{brcol}}, B{C{brrow}} are always leveled as a whole. Lines that have intersection 4835 with selected area, are leveled using polynomial coefficients computed only 4836 from data inside (or outside for B{C{exclude}} = B{C{True}}) the area. 4837 4838 @param col: Upper-left column coordinate. I{(int)} 4839 @param row: Upper-left row coordinate. I{(int)} 4840 @param width: Area width (number of columns). I{(int)} 4841 @param height: Area height (number of rows). I{(int)} 4842 @param degree: Fitted polynomial degree. I{(int)} 4843 @param exclude: If B{C{True}}, outside of area selected by B{C{ulcol}}, B{C{ulrow}}, B{C{brcol}}, 4844 B{C{brrow}} will be used for polynomial coefficients computation, 4845 instead of inside. I{(bool)} 4846 @param orientation: Line orientation. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 4847 """ 4848 pass
4849
4850 - def area_local_plane_quantity(size, col, row, width, height, type, result):
4851 """ 4852 Convenience function to get just one quantity from 4853 L{DataField.area_fit_local_planes}(). 4854 4855 4856 @param size: Neighbourhood size. I{(int)} 4857 @param col: Upper-left column coordinate. I{(int)} 4858 @param row: Upper-left row coordinate. I{(int)} 4859 @param width: Area width (number of columns). I{(int)} 4860 @param height: Area height (number of rows). I{(int)} 4861 @param type: The type of requested quantity. Expected values: C{B{PLANE_FIT_A}}, C{B{PLANE_FIT_BX}}, C{B{PLANE_FIT_BY}}, C{B{PLANE_FIT_ANGLE}}, C{B{PLANE_FIT_SLOPE}}, C{B{PLANE_FIT_S0}}, C{B{PLANE_FIT_S0_REDUCED}}. I{(L{PlaneFitQuantity})} 4862 @param result: A data field to store result to, or B{C{None}} to allocate a new one. I{(L{DataField})} 4863 @return: B{C{result}} if it isn't B{C{None}}, otherwise a newly allocated data field. I{(L{DataField})} 4864 """ 4865 return None
4866
4867 - def local_plane_quantity(size, type, result):
4868 """ 4869 Convenience function to get just one quantity from 4870 L{DataField.fit_local_planes}(). 4871 4872 4873 @param size: Neighbourhood size. I{(int)} 4874 @param type: The type of requested quantity. Expected values: C{B{PLANE_FIT_A}}, C{B{PLANE_FIT_BX}}, C{B{PLANE_FIT_BY}}, C{B{PLANE_FIT_ANGLE}}, C{B{PLANE_FIT_SLOPE}}, C{B{PLANE_FIT_S0}}, C{B{PLANE_FIT_S0_REDUCED}}. I{(L{PlaneFitQuantity})} 4875 @param result: A data field to store result to, or B{C{None}} to allocate a new one. I{(L{DataField})} 4876 @return: B{C{result}} if it isn't B{C{None}}, otherwise a newly allocated data field. I{(L{DataField})} 4877 """ 4878 return None
4879
4880 - def get_max():
4881 """ 4882 Finds the maximum value of a data field. 4883 4884 This quantity is cached. 4885 4886 4887 @return: The maximum value. I{(float)} 4888 """ 4889 return None
4890
4891 - def get_min():
4892 """ 4893 Finds the minimum value of a data field. 4894 4895 This quantity is cached. 4896 4897 4898 @return: The minimum value. I{(float)} 4899 """ 4900 return None
4901
4902 - def get_min_max():
4903 """ 4904 Finds minimum and maximum values of a data field. 4905 4906 @return: Tuple consisting of 2 values (B{C{min}}, B{C{max}}). (I{(float)}, I{(float)}) 4907 """ 4908 return None, None
4909
4910 - def get_avg():
4911 """ 4912 Computes average value of a data field. 4913 4914 This quantity is cached. 4915 4916 4917 @return: The average value. I{(float)} 4918 """ 4919 return None
4920
4921 - def get_rms():
4922 """ 4923 Computes root mean square value of a data field. 4924 4925 This quantity is cached. 4926 4927 4928 @return: The root mean square value. I{(float)} 4929 """ 4930 return None
4931
4932 - def get_sum():
4933 """ 4934 Sums all values in a data field. 4935 4936 This quantity is cached. 4937 4938 4939 @return: The sum of all values. I{(float)} 4940 """ 4941 return None
4942
4943 - def get_median():
4944 """ 4945 Computes median value of a data field. 4946 4947 This quantity is cached. 4948 4949 4950 @return: The median value. I{(float)} 4951 """ 4952 return None
4953
4954 - def get_surface_area():
4955 """ 4956 Computes surface area of a data field. 4957 4958 This quantity is cached. 4959 4960 4961 @return: The surface area. I{(float)} 4962 """ 4963 return None
4964
4965 - def get_variation():
4966 """ 4967 Computes the total variation of a data field. 4968 4969 See L{DataField.area_get_variation}() for the definition. 4970 4971 This quantity is cached. 4972 4973 @since: 2.38 4974 4975 @return: The variation. I{(float)} 4976 """ 4977 return None
4978
4979 - def get_entropy():
4980 """ 4981 Computes the entropy of a data field. 4982 4983 See L{DataField.area_get_entropy}() for the definition. 4984 4985 This quantity is cached. 4986 4987 @since: 2.42 4988 4989 @return: The value distribution entropy. I{(float)} 4990 """ 4991 return None
4992
4993 - def get_entropy_2d(yfield):
4994 """ 4995 Computes the entropy of a two-dimensional point cloud. 4996 4997 Each pair of corresponding B{C{xfield}} and B{C{yfield}} pixels is assumed to 4998 represent the coordinates (B{C{x}},B{C{y}}) of a point in plane. Hence they must have 4999 the same dimensions. 5000 5001 @since: 2.44 5002 5003 @param yfield: A data field containing the B{C{y}}-coordinates. I{(L{DataField})} 5004 @return: The two-dimensional distribution entropy. I{(float)} 5005 """ 5006 return None
5007
5008 - def area_get_max(mask, col, row, width, height):
5009 """ 5010 Finds the maximum value in a rectangular part of a data field. 5011 5012 5013 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5014 @param col: Upper-left column coordinate. I{(int)} 5015 @param row: Upper-left row coordinate. I{(int)} 5016 @param width: Area width (number of columns). I{(int)} 5017 @param height: Area height (number of rows). I{(int)} 5018 @return: The maximum value. When the number of samples to calculate 5019 maximum of is zero, -B{C{glib.MAXDOUBLE}} is returned. I{(float)} 5020 """ 5021 return None
5022
5023 - def area_get_min(mask, col, row, width, height):
5024 """ 5025 Finds the minimum value in a rectangular part of a data field. 5026 5027 5028 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5029 @param col: Upper-left column coordinate. I{(int)} 5030 @param row: Upper-left row coordinate. I{(int)} 5031 @param width: Area width (number of columns). I{(int)} 5032 @param height: Area height (number of rows). I{(int)} 5033 @return: The minimum value. When the number of samples to calculate 5034 minimum of is zero, -B{C{glib.MAXDOUBLE}} is returned. I{(float)} 5035 """ 5036 return None
5037
5038 - def area_get_min_max(mask, col, row, width, height):
5039 """ 5040 Finds minimum and maximum values in a rectangular part of a data field. 5041 5042 This function is equivalent to calling 5043 B{C{L{DataField.area_get_min_max_mask}}}() 5044 with masking mode B{C{MASK_INCLUDE}}. 5045 5046 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5047 @param col: Upper-left column coordinate. I{(int)} 5048 @param row: Upper-left row coordinate. I{(int)} 5049 @param width: Area width (number of columns). I{(int)} 5050 @param height: Area height (number of rows). I{(int)} 5051 @return: Tuple consisting of 2 values (B{C{min}}, B{C{max}}). (I{(float)}, I{(float)}) 5052 """ 5053 return None, None
5054
5055 - def area_get_min_max_mask(mask, mode, col, row, width, height):
5056 """ 5057 Finds minimum and maximum values in a rectangular part of a data field. 5058 5059 @since: 2.18 5060 5061 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5062 @param mode: Masking mode to use. See the introduction for description of 5063 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5064 @param col: Upper-left column coordinate. I{(int)} 5065 @param row: Upper-left row coordinate. I{(int)} 5066 @param width: Area width (number of columns). I{(int)} 5067 @param height: Area height (number of rows). I{(int)} 5068 @return: Tuple consisting of 2 values (B{C{min}}, B{C{max}}). (I{(float)}, I{(float)}) 5069 """ 5070 return None, None
5071
5072 - def area_get_avg(mask, col, row, width, height):
5073 """ 5074 Computes average value of a rectangular part of a data field. 5075 5076 This function is equivalent to calling B{C{L{DataField.area_get_avg_mask}}}() 5077 with masking mode B{C{MASK_INCLUDE}}. 5078 5079 5080 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5081 @param col: Upper-left column coordinate. I{(int)} 5082 @param row: Upper-left row coordinate. I{(int)} 5083 @param width: Area width (number of columns). I{(int)} 5084 @param height: Area height (number of rows). I{(int)} 5085 @return: The average value. I{(float)} 5086 """ 5087 return None
5088
5089 - def area_get_avg_mask(mask, mode, col, row, width, height):
5090 """ 5091 Computes average value of a rectangular part of a data field. 5092 5093 @since: 2.18 5094 5095 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5096 @param mode: Masking mode to use. See the introduction for description of 5097 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5098 @param col: Upper-left column coordinate. I{(int)} 5099 @param row: Upper-left row coordinate. I{(int)} 5100 @param width: Area width (number of columns). I{(int)} 5101 @param height: Area height (number of rows). I{(int)} 5102 @return: The average value. I{(float)} 5103 """ 5104 return None
5105
5106 - def area_get_rms(mask, col, row, width, height):
5107 """ 5108 Computes root mean square value of a rectangular part of a data field. 5109 5110 5111 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5112 @param col: Upper-left column coordinate. I{(int)} 5113 @param row: Upper-left row coordinate. I{(int)} 5114 @param width: Area width (number of columns). I{(int)} 5115 @param height: Area height (number of rows). I{(int)} 5116 @return: The root mean square value. 5117 5118 This function is equivalent to calling B{C{L{DataField.area_get_rms_mask}}}() 5119 with masking mode B{C{MASK_INCLUDE}}. I{(float)} 5120 """ 5121 return None
5122
5123 - def area_get_rms_mask(mask, mode, col, row, width, height):
5124 """ 5125 Computes root mean square value of deviations of a rectangular part of a 5126 data field. 5127 5128 @since: 2.18 5129 5130 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5131 @param mode: Masking mode to use. See the introduction for description of 5132 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5133 @param col: Upper-left column coordinate. I{(int)} 5134 @param row: Upper-left row coordinate. I{(int)} 5135 @param width: Area width (number of columns). I{(int)} 5136 @param height: Area height (number of rows). I{(int)} 5137 @return: The root mean square value of deviations from the mean value. I{(float)} 5138 """ 5139 return None
5140
5141 - def area_get_grainwise_rms(mask, mode, col, row, width, height):
5142 """ 5143 Computes grain-wise root mean square value of deviations of a rectangular 5144 part of a data field. 5145 5146 Grain-wise means that the mean value is determined for each grain (i.e. 5147 cotinguous part of the mask or inverted mask) separately and the deviations 5148 are calculated from these mean values. 5149 5150 @since: 2.29 5151 5152 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5153 @param mode: Masking mode to use. See the introduction for description of 5154 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5155 @param col: Upper-left column coordinate. I{(int)} 5156 @param row: Upper-left row coordinate. I{(int)} 5157 @param width: Area width (number of columns). I{(int)} 5158 @param height: Area height (number of rows). I{(int)} 5159 @return: The root mean square value of deviations from the mean value. I{(float)} 5160 """ 5161 return None
5162
5163 - def area_get_sum(mask, col, row, width, height):
5164 """ 5165 Sums values of a rectangular part of a data field. 5166 5167 This function is equivalent to calling B{C{L{DataField.area_get_sum_mask}}}() 5168 with masking mode B{C{MASK_INCLUDE}}. 5169 5170 5171 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5172 @param col: Upper-left column coordinate. I{(int)} 5173 @param row: Upper-left row coordinate. I{(int)} 5174 @param width: Area width (number of columns). I{(int)} 5175 @param height: Area height (number of rows). I{(int)} 5176 @return: The sum of all values inside area. I{(float)} 5177 """ 5178 return None
5179
5180 - def area_get_sum_mask(mask, mode, col, row, width, height):
5181 """ 5182 Sums values of a rectangular part of a data field. 5183 5184 @since: 2.18 5185 5186 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5187 @param mode: Masking mode to use. See the introduction for description of 5188 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5189 @param col: Upper-left column coordinate. I{(int)} 5190 @param row: Upper-left row coordinate. I{(int)} 5191 @param width: Area width (number of columns). I{(int)} 5192 @param height: Area height (number of rows). I{(int)} 5193 @return: The sum of all values inside area. I{(float)} 5194 """ 5195 return None
5196
5197 - def area_get_median(mask, col, row, width, height):
5198 """ 5199 Computes median value of a data field area. 5200 5201 This function is equivalent to calling 5202 B{C{L{DataField.area_get_median_mask}}}() 5203 with masking mode B{C{MASK_INCLUDE}}. 5204 5205 5206 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5207 @param col: Upper-left column coordinate. I{(int)} 5208 @param row: Upper-left row coordinate. I{(int)} 5209 @param width: Area width (number of columns). I{(int)} 5210 @param height: Area height (number of rows). I{(int)} 5211 @return: The median value. I{(float)} 5212 """ 5213 return None
5214
5215 - def area_get_median_mask(mask, mode, col, row, width, height):
5216 """ 5217 Computes median value of a data field area. 5218 5219 @since: 2.18 5220 5221 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5222 @param mode: Masking mode to use. See the introduction for description of 5223 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5224 @param col: Upper-left column coordinate. I{(int)} 5225 @param row: Upper-left row coordinate. I{(int)} 5226 @param width: Area width (number of columns). I{(int)} 5227 @param height: Area height (number of rows). I{(int)} 5228 @return: The median value. I{(float)} 5229 """ 5230 return None
5231
5232 - def area_get_surface_area(mask, col, row, width, height):
5233 """ 5234 Computes surface area of a rectangular part of a data field. 5235 5236 This function is equivalent to calling 5237 B{C{L{DataField.area_get_surface_area_mask}}}() with masking mode 5238 B{C{MASK_INCLUDE}}. 5239 5240 5241 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5242 @param col: Upper-left column coordinate. I{(int)} 5243 @param row: Upper-left row coordinate. I{(int)} 5244 @param width: Area width (number of columns). I{(int)} 5245 @param height: Area height (number of rows). I{(int)} 5246 @return: The surface area. I{(float)} 5247 """ 5248 return None
5249
5250 - def area_get_surface_area_mask(mask, mode, col, row, width, height):
5251 """ 5252 Computes surface area of a rectangular part of a data field. 5253 5254 This quantity makes sense only if the lateral dimensions and values of 5255 B{C{data_field}} are the same physical quantities. 5256 5257 @since: 2.18 5258 5259 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5260 @param mode: Masking mode to use. See the introduction for description of 5261 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5262 @param col: Upper-left column coordinate. I{(int)} 5263 @param row: Upper-left row coordinate. I{(int)} 5264 @param width: Area width (number of columns). I{(int)} 5265 @param height: Area height (number of rows). I{(int)} 5266 @return: The surface area. I{(float)} 5267 """ 5268 return None
5269
5270 - def area_get_entropy_at_scales(target_line, mask, mode, col, row, width, height, maxdiv):
5271 """ 5272 Calculates estimates of value distribution entropy at various scales. 5273 5274 @since: 2.44 5275 5276 @param target_line: A data line to store the result to. It will be resampled to 5277 B{C{maxdiv}}+1 items. I{(L{DataLine})} 5278 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5279 @param mode: Masking mode to use. See the introduction for description of 5280 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5281 @param col: Upper-left column coordinate. I{(int)} 5282 @param row: Upper-left row coordinate. I{(int)} 5283 @param width: Area width (number of columns). I{(int)} 5284 @param height: Area height (number of rows). I{(int)} 5285 @param maxdiv: Maximum number of divisions of the value range. Pass zero to 5286 choose it automatically. I{(int)} 5287 @return: The best estimate, as L{DataField.area_get_entropy}(). I{(float)} 5288 """ 5289 return None
5290
5291 - def get_entropy_2d_at_scales(yfield, target_line, maxdiv):
5292 """ 5293 Calculates estimates of entropy of two-dimensional point cloud at various 5294 scales. 5295 5296 @since: 2.44 5297 5298 @param yfield: A data field containing the B{C{y}}-coordinates. I{(L{DataField})} 5299 @param target_line: A data line to store the result to. It will be resampled to 5300 B{C{maxdiv}}+1 items. I{(L{DataLine})} 5301 @param maxdiv: Maximum number of divisions of the value range. Pass zero to 5302 choose it automatically. I{(int)} 5303 @return: The best estimate, as L{DataField.get_entropy_2d}(). I{(float)} 5304 """ 5305 return None
5306
5307 - def area_get_variation(mask, mode, col, row, width, height):
5308 """ 5309 Computes the total variation of a rectangular part of a data field. 5310 5311 The total variation is estimated as the integral of the absolute value of 5312 local gradient. 5313 5314 This quantity has the somewhat odd units of value unit times lateral unit. 5315 It can be envisioned as follows. If the surface has just two height levels 5316 (upper and lower planes) then the quantity is the length of the boundary 5317 between the upper and lower part, multiplied by the step height. If the 5318 surface is piece-wise constant, then the variation is the step height 5319 integrated along the boundaries between the constant parts. Therefore, for 5320 non-fractal surfaces it scales with the linear dimension of the image, not 5321 with its area, despite being an area integral. 5322 5323 @since: 2.38 5324 5325 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5326 @param mode: Masking mode to use. See the introduction for description of 5327 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5328 @param col: Upper-left column coordinate. I{(int)} 5329 @param row: Upper-left row coordinate. I{(int)} 5330 @param width: Area width (number of columns). I{(int)} 5331 @param height: Area height (number of rows). I{(int)} 5332 @return: The variation. I{(float)} 5333 """ 5334 return None
5335
5336 - def area_get_entropy(mask, mode, col, row, width, height):
5337 """ 5338 Estimates the entropy of field data distribution. 5339 5340 The estimate is calculated as B{C{S}} = ln(B{C{n}} Δ) − 1/B{C{n}} ∑ B{C{n_i}} ln(B{C{n_i}}), where 5341 B{C{n}} is the number of pixels considered, Δ the bin size and B{C{n_i}} the count in 5342 the B{C{i}}-th bin. If B{C{S}} is plotted as a function of the bin size Δ, it is, 5343 generally, a growing function with a plateau for ‘reasonable’ bin sizes. 5344 The estimate is taken at the plateau. If no plateau is found, which means 5345 the distribution is effectively a sum of δ-functions, -B{C{glib.MAXDOUBLE}} is 5346 returned. 5347 5348 It should be noted that this estimate may be biased. 5349 5350 @since: 2.42 5351 5352 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5353 @param mode: Masking mode to use. See the introduction for description of 5354 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5355 @param col: Upper-left column coordinate. I{(int)} 5356 @param row: Upper-left row coordinate. I{(int)} 5357 @param width: Area width (number of columns). I{(int)} 5358 @param height: Area height (number of rows). I{(int)} 5359 @return: The estimated entropy of the data values. The entropy of no data 5360 or a single single is returned as -B{C{glib.MAXDOUBLE}}. I{(float)} 5361 """ 5362 return None
5363
5364 - def area_get_volume(basis, mask, col, row, width, height):
5365 """ 5366 Computes volume of a rectangular part of a data field. 5367 5368 @since: 2.3 5369 5370 @param basis: The basis or background for volume calculation if not B{C{None}}. 5371 The height of each vertex is then the difference between 5372 B{C{data_field}} value and B{C{basis}} value. Value B{C{None}} is the same 5373 as passing all zeroes for the basis. I{(L{DataField})} 5374 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5375 @param col: Upper-left column coordinate. I{(int)} 5376 @param row: Upper-left row coordinate. I{(int)} 5377 @param width: Area width (number of columns). I{(int)} 5378 @param height: Area height (number of rows). I{(int)} 5379 @return: The volume. I{(float)} 5380 """ 5381 return None
5382
5383 - def get_autorange():
5384 """ 5385 Computes value range with outliers cut-off. 5386 5387 The purpose of this function is to find a range is suitable for false color 5388 mapping. The precise method how it is calculated is unspecified and may be 5389 subject to changes. 5390 5391 However, it is guaranteed minimum <= B{C{from}} <= B{C{to}} <= maximum. 5392 5393 This quantity is cached. 5394 5395 @return: Tuple consisting of 2 values (B{C{from_}}, B{C{to}}). (I{(float)}, I{(float)}) 5396 """ 5397 return None, None
5398
5399 - def get_stats():
5400 """ 5401 Computes basic statistical quantities of a data field. 5402 5403 @return: Tuple consisting of 5 values (B{C{avg}}, B{C{ra}}, B{C{rms}}, B{C{skew}}, B{C{kurtosis}}). (I{(float)}, I{(float)}, I{(float)}, I{(float)}, I{(float)}) 5404 """ 5405 return None, None, None, None, None
5406
5407 - def area_get_stats(mask, col, row, width, height):
5408 """ 5409 Computes basic statistical quantities of a rectangular part of a data field. 5410 5411 This function is equivalent to calling B{C{L{DataField.area_get_stats_mask}}}() 5412 with masking mode B{C{MASK_INCLUDE}}. 5413 5414 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5415 @param col: Upper-left column coordinate. I{(int)} 5416 @param row: Upper-left row coordinate. I{(int)} 5417 @param width: Area width (number of columns). I{(int)} 5418 @param height: Area height (number of rows). I{(int)} 5419 @return: Tuple consisting of 5 values (B{C{avg}}, B{C{ra}}, B{C{rms}}, B{C{skew}}, B{C{kurtosis}}). (I{(float)}, I{(float)}, I{(float)}, I{(float)}, I{(float)}) 5420 """ 5421 return None, None, None, None, None
5422
5423 - def area_get_stats_mask(mask, mode, col, row, width, height):
5424 """ 5425 Computes basic statistical quantities of a rectangular part of a data field. 5426 5427 @since: 2.18 5428 5429 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5430 @param mode: Masking mode to use. See the introduction for description of 5431 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5432 @param col: Upper-left column coordinate. I{(int)} 5433 @param row: Upper-left row coordinate. I{(int)} 5434 @param width: Area width (number of columns). I{(int)} 5435 @param height: Area height (number of rows). I{(int)} 5436 @return: Tuple consisting of 5 values (B{C{avg}}, B{C{ra}}, B{C{rms}}, B{C{skew}}, B{C{kurtosis}}). (I{(float)}, I{(float)}, I{(float)}, I{(float)}, I{(float)}) 5437 """ 5438 return None, None, None, None, None
5439
5440 - def area_count_in_range(mask, col, row, width, height, below, above):
5441 """ 5442 Counts data samples in given range. 5443 5444 No assertion is made about the values of B{C{above}} and B{C{below}}, in other words 5445 B{C{above}} may be larger than B{C{below}}. To count samples in an open interval 5446 instead of a closed interval, exchange B{C{below}} and B{C{above}} and then subtract 5447 the B{C{nabove}} and B{C{nbelow}} from B{C{width}}*B{C{height}} to get the complementary counts. 5448 5449 With this trick the common task of counting positive values can be 5450 realized: 5451 <informalexample><programlisting> 5452 L{DataField.area_count_in_range}(data_field, None, 5453 col, row, width, height, 5454 0.0, 0.0, &amp;count, None); 5455 count = width*height - count; 5456 </programlisting></informalexample> 5457 5458 @param mask: Mask specifying which values to take into account, or B{C{None}}. I{(L{DataField})} 5459 @param col: Upper-left column coordinate. I{(int)} 5460 @param row: Upper-left row coordinate. I{(int)} 5461 @param width: Area width (number of columns). I{(int)} 5462 @param height: Area height (number of rows). I{(int)} 5463 @param below: Upper bound to compare data to. The number of samples less 5464 than or equal to B{C{below}} is stored in B{C{nbelow}}. I{(float)} 5465 @param above: Lower bound to compare data to. The number of samples greater 5466 than or equal to B{C{above}} is stored in B{C{nabove}}. I{(float)} 5467 @return: Tuple consisting of 2 values (B{C{nbelow}}, B{C{nabove}}). (I{(int)}, I{(int)}) 5468 """ 5469 return None, None
5470
5471 - def area_dh(mask, target_line, col, row, width, height, nstats):
5472 """ 5473 Calculates distribution of heights in a rectangular part of data field. 5474 5475 @param mask: Mask specifying which values to take into account, or B{C{None}}. I{(L{DataField})} 5476 @param target_line: A data line to store the distribution to. It will be 5477 resampled to requested width. I{(L{DataLine})} 5478 @param col: Upper-left column coordinate. I{(int)} 5479 @param row: Upper-left row coordinate. I{(int)} 5480 @param width: Area width (number of columns). I{(int)} 5481 @param height: Area height (number of rows). I{(int)} 5482 @param nstats: The number of samples to take on the distribution function. If 5483 nonpositive, a suitable resolution is determined automatically. I{(int)} 5484 """ 5485 pass
5486
5487 - def dh(target_line, nstats):
5488 """ 5489 Calculates distribution of heights in a data field. 5490 5491 @param target_line: A data line to store the distribution to. It will be 5492 resampled to requested width. I{(L{DataLine})} 5493 @param nstats: The number of samples to take on the distribution function. If 5494 nonpositive, a suitable resolution is determined automatically. I{(int)} 5495 """ 5496 pass
5497
5498 - def area_cdh(mask, target_line, col, row, width, height, nstats):
5499 """ 5500 Calculates cumulative distribution of heights in a rectangular part of data 5501 field. 5502 5503 @param mask: Mask specifying which values to take into account, or B{C{None}}. I{(L{DataField})} 5504 @param target_line: A data line to store the distribution to. It will be 5505 resampled to requested width. I{(L{DataLine})} 5506 @param col: Upper-left column coordinate. I{(int)} 5507 @param row: Upper-left row coordinate. I{(int)} 5508 @param width: Area width (number of columns). I{(int)} 5509 @param height: Area height (number of rows). I{(int)} 5510 @param nstats: The number of samples to take on the distribution function. If 5511 nonpositive, a suitable resolution is determined automatically. I{(int)} 5512 """ 5513 pass
5514
5515 - def cdh(target_line, nstats):
5516 """ 5517 Calculates cumulative distribution of heights in a data field. 5518 5519 @param target_line: A data line to store the distribution to. It will be 5520 resampled to requested width. I{(L{DataLine})} 5521 @param nstats: The number of samples to take on the distribution function. If 5522 nonpositive, a suitable resolution is determined automatically. I{(int)} 5523 """ 5524 pass
5525
5526 - def area_da(target_line, col, row, width, height, orientation, nstats):
5527 """ 5528 Calculates distribution of slopes in a rectangular part of data field. 5529 5530 @param target_line: A data line to store the distribution to. It will be 5531 resampled to requested width. I{(L{DataLine})} 5532 @param col: Upper-left column coordinate. I{(int)} 5533 @param row: Upper-left row coordinate. I{(int)} 5534 @param width: Area width (number of columns). I{(int)} 5535 @param height: Area height (number of rows). I{(int)} 5536 @param orientation: Orientation to compute the slope distribution in. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 5537 @param nstats: The number of samples to take on the distribution function. If 5538 nonpositive, a suitable resolution is determined automatically. I{(int)} 5539 """ 5540 pass
5541
5542 - def area_da_mask(mask, target_line, col, row, width, height, orientation, nstats):
5543 """ 5544 Calculates distribution of slopes in a rectangular part of data field, with 5545 masking. 5546 5547 @since: 2.49 5548 5549 @param mask: Mask specifying which values to take into account, or B{C{None}}. I{(L{DataField})} 5550 @param target_line: A data line to store the distribution to. It will be 5551 resampled to requested width. I{(L{DataLine})} 5552 @param col: Upper-left column coordinate. I{(int)} 5553 @param row: Upper-left row coordinate. I{(int)} 5554 @param width: Area width (number of columns). I{(int)} 5555 @param height: Area height (number of rows). I{(int)} 5556 @param orientation: Orientation to compute the slope distribution in. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 5557 @param nstats: The number of samples to take on the distribution function. If 5558 nonpositive, a suitable resolution is determined automatically. I{(int)} 5559 """ 5560 pass
5561
5562 - def da(target_line, orientation, nstats):
5563 """ 5564 Calculates distribution of slopes in a data field. 5565 5566 @param target_line: A data line to store the distribution to. It will be 5567 resampled to requested width. I{(L{DataLine})} 5568