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}}. 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}}. 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}}. 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}}. 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 @param kernel_field: Correlation kernel. I{(L{DataField})} 2399 @param score: Data field to store correlation scores to. I{(L{DataField})} 2400 @param method: Correlation score calculation method. Expected values: C{B{CORRELATION_NORMAL}}, C{B{CORRELATION_FFT}}, C{B{CORRELATION_POC}}. I{(L{CorrelationType})} 2401 """ 2402 pass
2403
2404 - def correlate_init(kernel_field, score):
2405 """ 2406 Creates a new correlation iterator. 2407 2408 This iterator reports its state as B{C{ComputationStateType}}. 2409 2410 2411 @param kernel_field: Kernel to correlate data field with. I{(L{DataField})} 2412 @param score: Data field to store correlation scores to. I{(L{DataField})} 2413 @return: A new correlation iterator. I{(ComputationState*)} 2414 """ 2415 return None
2416
2417 - def invalidate():
2418 """ 2419 Invalidates cached data field stats. 2420 2421 User code should rarely need this macro, as all B{C{DataField}} methods do 2422 proper invalidation when they change data, as well as 2423 L{DataField.get_data}() does. 2424 2425 However, if you get raw data with L{DataField.get_data}() and then mix 2426 direct changes to it with calls to methods like L{DataField.get_max}(), 2427 you may need to explicitely invalidate cached values to let 2428 L{DataField.get_max}() know it has to recompute the maximum. 2429 2430 """ 2431 pass
2432
2433 - def new_alike(nullme):
2434 """ 2435 Creates a new data field similar to an existing one. 2436 2437 Use L{DataField.duplicate}() if you want to copy a data field including 2438 data. 2439 2440 2441 @param nullme: Whether the data field should be initialized to zeroes. If B{C{False}}, 2442 the data will not be initialized. I{(bool)} 2443 @return: A newly created data field. I{(L{DataField})} 2444 """ 2445 return None
2446
2447 - def data_changed():
2448 """ 2449 Emits signal "data-changed" on a data field. 2450 2451 """ 2452 pass
2453
2454 - def new_resampled(xres, yres, interpolation):
2455 """ 2456 Creates a new data field by resampling an existing one. 2457 2458 This method is equivalent to L{DataField.duplicate}() followed by 2459 L{DataField.resample}(), but it is more efficient. 2460 2461 2462 @param xres: Desired X resolution. I{(int)} 2463 @param yres: Desired Y resolution. I{(int)} 2464 @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})} 2465 @return: A newly created data field. I{(L{DataField})} 2466 """ 2467 return None
2468
2469 - def resample(xres, yres, interpolation):
2470 """ 2471 Resamples a data field using given interpolation method 2472 2473 This method may invalidate raw data buffer returned by 2474 L{DataField.get_data}(). 2475 2476 @param xres: Desired X resolution. I{(int)} 2477 @param yres: Desired Y resolution. I{(int)} 2478 @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})} 2479 """ 2480 pass
2481
2482 - def resize(ulcol, ulrow, brcol, brrow):
2483 """ 2484 Resizes (crops) a data field. 2485 2486 Crops a data field to a rectangle between upper-left and bottom-right 2487 points, recomputing real size. 2488 2489 This method may invalidate raw data buffer returned by 2490 L{DataField.get_data}(). 2491 2492 @param ulcol: Upper-left column coordinate. I{(int)} 2493 @param ulrow: Upper-left row coordinate. I{(int)} 2494 @param brcol: Bottom-right column coordinate + 1. I{(int)} 2495 @param brrow: Bottom-right row coordinate + 1. I{(int)} 2496 """ 2497 pass
2498
2499 - def area_extract(col, row, width, height):
2500 """ 2501 Extracts a rectangular part of a data field to a new data field. 2502 2503 2504 @param col: Upper-left column coordinate. I{(int)} 2505 @param row: Upper-left row coordinate. I{(int)} 2506 @param width: Area width (number of columns). I{(int)} 2507 @param height: Area height (number of rows). I{(int)} 2508 @return: The extracted area as a newly created data field. I{(L{DataField})} 2509 """ 2510 return None
2511
2512 - def copy(dest, nondata_too):
2513 """ 2514 Copies the contents of an already allocated data field to a data field 2515 of the same size. 2516 2517 @param dest: Destination data field. I{(L{DataField})} 2518 @param nondata_too: Whether non-data (units) should be copied too. I{(bool)} 2519 """ 2520 pass
2521
2522 - def area_copy(dest, col, row, width, height, destcol, destrow):
2523 """ 2524 Copies a rectangular area from one data field to another. 2525 2526 The area starts at (B{C{col}}, B{C{row}}) in B{C{src}} and its dimension is B{C{width}}*B{C{height}}. 2527 It is copied to B{C{dest}} starting from (B{C{destcol}}, B{C{destrow}}). 2528 2529 The source area has to be completely contained in B{C{src}}. No assumptions are 2530 made about destination position, however, parts of the source area sticking 2531 out the destination data field B{C{dest}} are cut off. 2532 2533 If B{C{src}} is equal to B{C{dest}}, the areas may not overlap. 2534 2535 @param dest: Destination data field. I{(L{DataField})} 2536 @param col: Area upper-left column coordinate in B{C{src}}. I{(int)} 2537 @param row: Area upper-left row coordinate B{C{src}}. I{(int)} 2538 @param width: Area width (number of columns), pass -1 for full B{C{src}} widdth. I{(int)} 2539 @param height: Area height (number of rows), pass -1 for full B{C{src}} height. I{(int)} 2540 @param destcol: Destination column in B{C{dest}}. I{(int)} 2541 @param destrow: Destination row in B{C{dest}}. I{(int)} 2542 """ 2543 pass
2544
2545 - def get_xres():
2546 """ 2547 Gets X resolution (number of columns) of a data field. 2548 2549 2550 @return: X resolution. I{(int)} 2551 """ 2552 return None
2553
2554 - def get_yres():
2555 """ 2556 Gets Y resolution (number of rows) of the field. 2557 2558 2559 @return: Y resolution. I{(int)} 2560 """ 2561 return None
2562
2563 - def get_xreal():
2564 """ 2565 Gets the X real (physical) size of a data field. 2566 2567 2568 @return: X real size value. I{(float)} 2569 """ 2570 return None
2571
2572 - def get_yreal():
2573 """ 2574 Gets the Y real (physical) size of a data field. 2575 2576 2577 @return: Y real size value. I{(float)} 2578 """ 2579 return None
2580
2581 - def set_xreal(xreal):
2582 """ 2583 Sets X real (physical) size value of a data field. 2584 2585 @param xreal: New X real size value. I{(float)} 2586 """ 2587 pass
2588
2589 - def set_yreal(yreal):
2590 """ 2591 Sets Y real (physical) size value of a data field. 2592 2593 @param yreal: New Y real size value. I{(float)} 2594 """ 2595 pass
2596
2597 - def get_xoffset():
2598 """ 2599 Gets the X offset of data field origin. 2600 2601 2602 @return: X offset value. I{(float)} 2603 """ 2604 return None
2605
2606 - def get_yoffset():
2607 """ 2608 Gets the Y offset of data field origin. 2609 2610 2611 @return: Y offset value. I{(float)} 2612 """ 2613 return None
2614
2615 - def set_xoffset(xoff):
2616 """ 2617 Sets the X offset of a data field origin. 2618 2619 Note offsets don't affect any calculation, nor functions like 2620 L{DataField.rtoj}(). 2621 2622 @param xoff: New X offset value. I{(float)} 2623 """ 2624 pass
2625
2626 - def set_yoffset(yoff):
2627 """ 2628 Sets the Y offset of a data field origin. 2629 2630 Note offsets don't affect any calculation, nor functions like 2631 L{DataField.rtoi}(). 2632 2633 @param yoff: New Y offset value. I{(float)} 2634 """ 2635 pass
2636
2637 - def get_si_unit_xy():
2638 """ 2639 Returns lateral SI unit of a data field. 2640 2641 2642 @return: SI unit corresponding to the lateral (XY) dimensions of the data 2643 field. Its reference count is not incremented. I{(L{SIUnit})} 2644 """ 2645 return None
2646
2647 - def get_si_unit_z():
2648 """ 2649 Returns value SI unit of a data field. 2650 2651 2652 @return: SI unit corresponding to the "height" (Z) dimension of the data 2653 field. Its reference count is not incremented. I{(L{SIUnit})} 2654 """ 2655 return None
2656
2657 - def set_si_unit_xy(si_unit):
2658 """ 2659 Sets the SI unit corresponding to the lateral (XY) dimensions of a data 2660 field. 2661 2662 It does not assume a reference on B{C{si_unit}}, instead it adds its own 2663 reference. 2664 2665 @param si_unit: SI unit to be set. I{(L{SIUnit})} 2666 """ 2667 pass
2668
2669 - def set_si_unit_z(si_unit):
2670 """ 2671 Sets the SI unit corresponding to the "height" (Z) dimension of a data 2672 field. 2673 2674 It does not assume a reference on B{C{si_unit}}, instead it adds its own 2675 reference. 2676 2677 @param si_unit: SI unit to be set. I{(L{SIUnit})} 2678 """ 2679 pass
2680
2681 - def get_value_format_xy(style):
2682 """ 2683 Finds value format good for displaying coordinates of a data field. 2684 2685 2686 @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}}. I{(L{SIUnitFormatStyle})} 2687 @return: Tuple consisting of 2 values (B{C{value}}, B{C{format}}). (I{(L{SIValueFormat})}, I{(SkipArg)}) 2688 """ 2689 return None, None
2690
2691 - def get_value_format_z(style):
2692 """ 2693 Finds value format good for displaying values of a data field. 2694 2695 2696 @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}}. I{(L{SIUnitFormatStyle})} 2697 @return: Tuple consisting of 2 values (B{C{value}}, B{C{format}}). (I{(L{SIValueFormat})}, I{(SkipArg)}) 2698 """ 2699 return None, None
2700
2701 - def copy_units(target):
2702 """ 2703 Sets lateral and value units of a data field to match another data field. 2704 2705 @since: 2.49 2706 2707 @param target: Target data field. I{(L{DataField})} 2708 """ 2709 pass
2710
2711 - def copy_units_to_data_line(data_line):
2712 """ 2713 Sets lateral and value units of a data line to match a data field. 2714 2715 @param data_line: A data line to set units of. I{(L{DataLine})} 2716 """ 2717 pass
2718
2719 - def itor(row):
2720 """ 2721 Transforms vertical pixel coordinate to real (physical) Y coordinate. 2722 2723 That is it maps range [0..y-resolution] to range [0..real-y-size]. 2724 It is not suitable for conversion of matrix indices to physical coordinates, 2725 you have to use L{DataField.itor}(B{C{data_field}}, B{C{row}} + 0.5) for that. 2726 2727 2728 @param row: Vertical pixel coordinate. I{(float)} 2729 @return: Real Y coordinate. I{(float)} 2730 """ 2731 return None
2732
2733 - def jtor(col):
2734 """ 2735 Transforms horizontal pixel coordinate to real (physical) X coordinate. 2736 2737 That is it maps range [0..x-resolution] to range [0..real-x-size]. 2738 It is not suitable for conversion of matrix indices to physical coordinates, 2739 you have to use L{DataField.jtor}(B{C{data_field}}, B{C{col}} + 0.5) for that. 2740 2741 2742 @param col: Horizontal pixel coordinate. I{(float)} 2743 @return: Real X coordinate. I{(float)} 2744 """ 2745 return None
2746
2747 - def rtoi(realy):
2748 """ 2749 Transforms real (physical) Y coordinate to row. 2750 2751 That is it maps range [0..real-y-size] to range [0..y-resolution]. 2752 2753 2754 @param realy: Real (physical) Y coordinate. I{(float)} 2755 @return: Vertical pixel coodinate. I{(float)} 2756 """ 2757 return None
2758
2759 - def rtoj(realx):
2760 """ 2761 Transforms real (physical) X coordinate to column. 2762 2763 That is it maps range [0..real-x-size] to range [0..x-resolution]. 2764 2765 2766 @param realx: Real (physical) X coodinate. I{(float)} 2767 @return: Horizontal pixel coordinate. I{(float)} 2768 """ 2769 return None
2770
2771 - def get_val(col, row):
2772 """ 2773 Gets value at given position in a data field. 2774 2775 Do not access data with this function inside inner loops, it's slow. 2776 Get the raw data buffer with L{DataField.get_data_const}() and access it 2777 directly instead. 2778 2779 2780 @param col: Column index. I{(int)} 2781 @param row: Row index. I{(int)} 2782 @return: Value at (B{C{col}}, B{C{row}}). I{(float)} 2783 """ 2784 return None
2785
2786 - def set_val(col, row, value):
2787 """ 2788 Sets value at given position in a data field. 2789 2790 Do not set data with this function inside inner loops, it's slow. Get the 2791 raw data buffer with L{DataField.get_data}() and write to it directly 2792 instead. 2793 2794 @param col: Column index. I{(int)} 2795 @param row: Row index. I{(int)} 2796 @param value: Value to set. I{(float)} 2797 """ 2798 pass
2799
2800 - def get_dval(x, y, interpolation):
2801 """ 2802 Gets interpolated value at arbitrary data field point indexed by pixel 2803 coordinates. 2804 2805 Note pixel values are centered in pixels, so to get the same 2806 value as L{DataField.get_val}(B{C{data_field}}, B{C{j}}, B{C{i}}) returns, 2807 it's necessary to add 0.5: 2808 L{DataField.get_dval}(B{C{data_field}}, B{C{j}}+0.5, B{C{i}}+0.5, B{C{interpolation}}). 2809 2810 See also L{DataField.get_dval_real}() that does the same, but takes 2811 real coordinates. 2812 2813 2814 @param x: Horizontal position in pixel units, in range [0, x-resolution]. I{(float)} 2815 @param y: Vertical postition in pixel units, in range [0, y-resolution]. I{(float)} 2816 @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})} 2817 @return: Interpolated value at position (B{C{x}},B{C{y}}). I{(float)} 2818 """ 2819 return None
2820
2821 - def get_dval_real(x, y, interpolation):
2822 """ 2823 Gets interpolated value at arbitrary data field point indexed by real 2824 coordinates. 2825 2826 See also L{DataField.get_dval}() that does the same, but takes pixel 2827 coordinates. 2828 2829 2830 @param x: X postion in real coordinates. I{(float)} 2831 @param y: Y postition in real coordinates. I{(float)} 2832 @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})} 2833 @return: Value at position (B{C{x}},B{C{y}}). I{(float)} 2834 """ 2835 return None
2836
2837 - def rotate(angle, interpolation):
2838 """ 2839 Rotates a data field by a given angle. 2840 2841 This function is mostly obsolete. See L{DataField.new_rotated}() 2842 and L{DataField.new_rotated_90}(). 2843 2844 Values that get outside of data field by the rotation are lost. 2845 Undefined values from outside of data field that get inside are set to 2846 data field minimum value. 2847 2848 The rotation is performed in pixel space, i.e. it can be in fact a more 2849 general affine transform in the real coordinates when pixels are not square. 2850 2851 @param angle: Rotation angle (in radians). I{(float)} 2852 @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})} 2853 """ 2854 pass
2855
2856 - def new_rotated(exterior_mask, angle, interp, resize):
2857 """ 2858 Creates a new data field by rotating a data field by an atribtrary angle. 2859 2860 The returned data field can have pixel corresponding to exterior in B{C{dfield}} 2861 (unless B{C{resize}} is B{C{ROTATE_RESIZE_CUT}}). They are filled with a neutral 2862 value; pass B{C{exterior_mask}} and replace them as you wish if you need more 2863 control. 2864 2865 The rotation is performed in real space, i.e. it is a more general affine 2866 transform in the pixel space for data field with non-square pixels. 2867 See L{DataField.rotate}() which rotates in the pixel space. 2868 2869 The returned data field has usually square pixels, the exception being when 2870 B{C{angle}} is a multiple of B{C{glib.PI}}/2 when the function reduces to 2871 L{DataField.new_rotated_90}() and original pixels are preserved. This is 2872 of concern only when B{C{dfield}} has non-square pixels. 2873 2874 @since: 2.46 2875 2876 @param exterior_mask: Optional data field where pixels corresponding to exterior 2877 will be set to 1. It will be resized to match the returned 2878 field. I{(L{DataField})} 2879 @param angle: Rotation angle (in radians). I{(float)} 2880 @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})} 2881 @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})} 2882 @return: A newly created data field. I{(L{DataField})} 2883 """ 2884 return None
2885
2886 - def new_rotated_90(clockwise):
2887 """ 2888 Creates a new data field by rotating a data field by 90 degrees. 2889 2890 @since: 2.46 2891 2892 @param clockwise: B{C{True}} to rotate clocwise, B{C{False}} to rotate anti-clockwise. I{(bool)} 2893 @return: A newly created data field. I{(L{DataField})} 2894 """ 2895 return None
2896
2897 - def invert(x, y, z):
2898 """ 2899 Reflects amd/or inverts a data field. 2900 2901 In the case of value reflection, it's inverted about the mean value. 2902 2903 @param x: B{C{True}} to reflect about X axis (i.e., invert columns vertically). I{(bool)} 2904 @param y: B{C{True}} to reflect about Y axis (i.e., invert rows horizontally). I{(bool)} 2905 @param z: B{C{True}} to invert in Z direction (i.e., invert values). I{(bool)} 2906 """ 2907 pass
2908
2909 - def flip_xy(dest, minor):
2910 """ 2911 Copies data from one data field to another with transposition. 2912 2913 The destination data field is resized as necessary, its real dimensions set 2914 to transposed B{C{src}} dimensions and its offsets are reset. Units are not 2915 updated. 2916 2917 @since: 2.49 2918 2919 @param dest: Destination data field. I{(L{DataField})} 2920 @param minor: B{C{True}} to mirror about the minor diagonal; B{C{False}} to mirror about 2921 major diagonal. I{(bool)} 2922 """ 2923 pass
2924
2925 - def area_flip_xy(col, row, width, height, dest, minor):
2926 """ 2927 Copies data from a rectangular part of one data field to another with 2928 transposition. 2929 2930 The destination data field is resized as necessary, its real dimensions set 2931 to transposed B{C{src}} area dimensions and its offsets are reset. Units are not 2932 updated. 2933 2934 @since: 2.49 2935 2936 @param col: Upper-left column coordinate in B{C{src}}. I{(int)} 2937 @param row: Upper-left row coordinate in B{C{src}}. I{(int)} 2938 @param width: Area width (number of columns) in B{C{src}}. I{(int)} 2939 @param height: Area height (number of rows) in B{C{src}}. I{(int)} 2940 @param dest: Destination data field. I{(L{DataField})} 2941 @param minor: B{C{True}} to mirror about the minor diagonal; B{C{False}} to mirror about 2942 major diagonal. I{(bool)} 2943 """ 2944 pass
2945
2946 - def fill(value):
2947 """ 2948 Fills a data field with given value. 2949 2950 @param value: Value to be entered. I{(float)} 2951 """ 2952 pass
2953
2954 - def clear():
2955 """ 2956 Fills a data field with zeroes. 2957 2958 """ 2959 pass
2960
2961 - def multiply(value):
2962 """ 2963 Multiplies all values in a data field by given value. 2964 2965 @param value: Value to multiply B{C{data_field}} with. I{(float)} 2966 """ 2967 pass
2968
2969 - def add(value):
2970 """ 2971 Adds given value to all values in a data field. 2972 2973 @param value: Value to be added to data field values. I{(float)} 2974 """ 2975 pass
2976
2977 - def area_fill(col, row, width, height, value):
2978 """ 2979 Fills a rectangular part of a data field with given value. 2980 2981 @param col: Upper-left column coordinate. I{(int)} 2982 @param row: Upper-left row coordinate. I{(int)} 2983 @param width: Area width (number of columns). I{(int)} 2984 @param height: Area height (number of rows). I{(int)} 2985 @param value: Value to be entered I{(float)} 2986 """ 2987 pass
2988
2989 - def area_fill_mask(mask, mode, col, row, width, height, value):
2990 """ 2991 Fills a masked rectangular part of a data field with given value. 2992 2993 @since: 2.44 2994 2995 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 2996 @param mode: Masking mode to use. See the introduction for description of 2997 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 2998 @param col: Upper-left column coordinate. I{(int)} 2999 @param row: Upper-left row coordinate. I{(int)} 3000 @param width: Area width (number of columns). I{(int)} 3001 @param height: Area height (number of rows). I{(int)} 3002 @param value: Value to be entered I{(float)} 3003 """ 3004 pass
3005
3006 - def area_clear(col, row, width, height):
3007 """ 3008 Fills a rectangular part of a data field with zeroes. 3009 3010 @param col: Upper-left column coordinate. I{(int)} 3011 @param row: Upper-left row coordinate. I{(int)} 3012 @param width: Area width (number of columns). I{(int)} 3013 @param height: Area height (number of rows). I{(int)} 3014 """ 3015 pass
3016
3017 - def area_multiply(col, row, width, height, value):
3018 """ 3019 Multiplies values in a rectangular part of a data field by given value 3020 3021 @param col: Upper-left column coordinate. I{(int)} 3022 @param row: Upper-left row coordinate. I{(int)} 3023 @param width: Area width (number of columns). I{(int)} 3024 @param height: Area height (number of rows). I{(int)} 3025 @param value: Value to multiply area with. I{(float)} 3026 """ 3027 pass
3028
3029 - def area_add(col, row, width, height, value):
3030 """ 3031 Adds given value to all values in a rectangular part of a data field. 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 added to area values. I{(float)} 3038 """ 3039 pass
3040
3041 - def get_profile(scol, srow, ecol, erow, res, thickness, interpolation):
3042 """ 3043 Extracts a possibly averaged profile from data field to a data line. 3044 3045 3046 @param scol: The column the line starts at (inclusive). I{(int)} 3047 @param srow: The row the line starts at (inclusive). I{(int)} 3048 @param ecol: The column the line ends at (inclusive). I{(int)} 3049 @param erow: The row the line ends at (inclusive). I{(int)} 3050 @param res: Requested resolution of data line (the number of samples to take). 3051 If nonpositive, data line resolution is chosen to match B{C{data_field}}'s. I{(int)} 3052 @param thickness: Thickness of line to be averaged. I{(int)} 3053 @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})} 3054 @return: Tuple consisting of 2 values (B{C{value}}, B{C{data_line}}). (I{(L{DataLine})}, I{(SkipArg)}) 3055 """ 3056 return None, None
3057
3058 - def get_row(data_line, row):
3059 """ 3060 Extracts a data field row into a data line. 3061 3062 @param data_line: A data line. It will be resized to width ot B{C{data_field}}. I{(L{DataLine})} 3063 @param row: Row index. I{(int)} 3064 """ 3065 pass
3066
3067 - def get_column(data_line, col):
3068 """ 3069 Extracts a data field column into a data line. 3070 3071 @param data_line: A data line. It will be resized to height of B{C{data_field}}. I{(L{DataLine})} 3072 @param col: Column index. I{(int)} 3073 """ 3074 pass
3075
3076 - def set_row(data_line, row):
3077 """ 3078 Sets a row in the data field to values of a data line. 3079 3080 Data line length must be equal to width of data field. 3081 3082 @param data_line: A data line. I{(L{DataLine})} 3083 @param row: Row index. I{(int)} 3084 """ 3085 pass
3086
3087 - def set_column(data_line, col):
3088 """ 3089 Sets a column in the data field to values of a data line. 3090 3091 Data line length must be equal to height of data field. 3092 3093 @param data_line: A data line. I{(L{DataLine})} 3094 @param col: Column index. I{(int)} 3095 """ 3096 pass
3097
3098 - def get_row_part(data_line, row, from_, to):
3099 """ 3100 Extracts part of a data field row into a data line. 3101 3102 @param data_line: A data line. It will be resized to the row part width. I{(L{DataLine})} 3103 @param row: Row index. I{(int)} 3104 @param from_: I{(int)} 3105 @param to: End column index + 1. I{(int)} 3106 """ 3107 pass
3108
3109 - def get_column_part(data_line, col, from_, to):
3110 """ 3111 Extracts part of a data field column into a data line. 3112 3113 @param data_line: A data line. It will be resized to the column part height. I{(L{DataLine})} 3114 @param col: Column index. I{(int)} 3115 @param from_: I{(int)} 3116 @param to: End row index + 1. I{(int)} 3117 """ 3118 pass
3119
3120 - def set_row_part(data_line, row, from_, to):
3121 """ 3122 Puts a data line into a data field row. 3123 3124 If data line length differs from B{C{to}}-B{C{from}}, it is resampled to this length. 3125 3126 @param data_line: A data line. I{(L{DataLine})} 3127 @param row: Row index. I{(int)} 3128 @param from_: I{(int)} 3129 @param to: End row index + 1. I{(int)} 3130 """ 3131 pass
3132
3133 - def set_column_part(data_line, col, from_, to):
3134 """ 3135 Puts a data line into data field column. 3136 3137 If data line length differs from B{C{to}}-B{C{from}}, it is resampled to this length. 3138 3139 @param data_line: A data line. I{(L{DataLine})} 3140 @param col: Column index. I{(int)} 3141 @param from_: I{(int)} 3142 @param to: End row index + 1. I{(int)} 3143 """ 3144 pass
3145
3146 - def get_xder(col, row):
3147 """ 3148 Computes central derivative in X direction. 3149 3150 On border points, one-side derivative is returned. 3151 3152 3153 @param col: Column index. I{(int)} 3154 @param row: Row index. I{(int)} 3155 @return: Derivative in X direction. I{(float)} 3156 """ 3157 return None
3158
3159 - def get_yder(col, row):
3160 """ 3161 Computes central derivative in Y direction. 3162 3163 On border points, one-side derivative is returned. 3164 3165 Note the derivative is for legacy reasons calulcated for the opposite 3166 y direction than is usual elsewhere in Gwyddion, i.e. if values increase 3167 with increasing row number, the returned value is negative. 3168 3169 3170 @param col: Column index. I{(int)} 3171 @param row: Row index. I{(int)} 3172 @return: Derivative in Y direction I{(float)} 3173 """ 3174 return None
3175
3176 - def get_angder(col, row, theta):
3177 """ 3178 Computes derivative in direction specified by given angle. 3179 3180 3181 @param col: Column index. I{(int)} 3182 @param row: Row index. I{(int)} 3183 @param theta: Angle defining the direction (in radians, counterclockwise). I{(float)} 3184 @return: Derivative in direction given by angle B{C{theta}}. I{(float)} 3185 """ 3186 return None
3187
3188 - def average_xyz(density_map, points, npoints):
3189 """ 3190 Fills a data field with regularised XYZ data using a simple method. 3191 3192 The real dimensions and offsets of B{C{field}} determine the rectangle in the XY 3193 plane that will be regularised. The regularisation method is fast but 3194 simple and there are no absolute guarantees of quality, even though the 3195 result will be usually quite acceptable. 3196 3197 This especially applies to reasonable views of the XYZ data. Unreasonable 3198 views can be rendered unreasonably. In particular if the rectangle does not 3199 contain any point from B{C{points}} (either due to high zoom to an empty region 3200 or by just being completely off) B{C{data_field}} will be filled entirely with 3201 the value of the closest point or something similar. 3202 3203 @since: 2.44 3204 3205 @param density_map: Optional data field to fill with XYZ point density map. It can 3206 be B{C{None}}. I{(L{DataField})} 3207 @param points: Array of XYZ points. Coordinates X and Y represent positions in 3208 the plane; the Z-coordinate represents values. I{(const-XYZ*)} 3209 @param npoints: Number of points. I{(int)} 3210 """ 3211 pass
3212
3213 - def xdwt(wt_coefs, direction, minsize):
3214 """ 3215 Performs steps of the X-direction image wavelet decomposition. 3216 3217 The smallest low pass coefficients block is equal to B{C{minsize}}. Run with 3218 B{C{minsize}} = B{C{dfield}}->xres/2 to perform one step of decomposition 3219 or B{C{minsize}} = 4 to perform full decomposition (or anything between). 3220 3221 3222 @param wt_coefs: Data line where the wavelet transform coefficients are stored. I{(L{DataLine})} 3223 @param direction: Transform direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 3224 @param minsize: size of minimal transform result block I{(int)} 3225 """ 3226 pass
3227
3228 - def ydwt(wt_coefs, direction, minsize):
3229 """ 3230 Performs steps of the Y-direction image wavelet decomposition. 3231 3232 The smallest low pass coefficients block is equal to B{C{minsize}}. Run with 3233 B{C{minsize}} = B{C{dfield}}->yres/2 to perform one step of decomposition 3234 or B{C{minsize}} = 4 to perform full decomposition (or anything between). 3235 3236 3237 @param wt_coefs: Data line where the wavelet transform coefficients are stored. I{(L{DataLine})} 3238 @param direction: Transform direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 3239 @param minsize: size of minimal transform result block I{(int)} 3240 """ 3241 pass
3242
3243 - def dwt(wt_coefs, direction, minsize):
3244 """ 3245 Performs steps of the 2D image wavelet decomposition. 3246 3247 The smallest low pass coefficients block is equal to B{C{minsize}}. Run with 3248 B{C{minsize}} = B{C{dfield}}->xres/2 to perform one step of decomposition 3249 or B{C{minsize}} = 4 to perform full decomposition (or anything between). 3250 3251 3252 @param wt_coefs: Data line where the wavelet transform coefficients are stored. I{(L{DataLine})} 3253 @param direction: Transform direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 3254 @param minsize: size of minimal transform result block I{(int)} 3255 """ 3256 pass
3257
3258 - def dwt_mark_anisotropy(mask, wt_coefs, ratio, lowlimit):
3259 """ 3260 Performs steps of the 2D image wavelet decomposition. 3261 3262 The smallest low pass coefficients block is equal to B{C{minsize}}. Run with 3263 B{C{minsize}} = B{C{dfield}}->xres/2 to perform one step of decomposition 3264 or B{C{minsize}} = 4 to perform full decomposition (or anything between). 3265 3266 3267 @param mask: I{(L{DataField})} 3268 @param wt_coefs: Data line to store wavelet transform coefficients to. I{(L{DataLine})} 3269 @param ratio: I{(float)} 3270 @param lowlimit: I{(int)} 3271 """ 3272 pass
3273
3274 - def elliptic_area_fill(col, row, width, height, value):
3275 """ 3276 Fills an elliptic region of a data field with given value. 3277 3278 The elliptic region is defined by its bounding box which must be completely 3279 contained in the data field. 3280 3281 3282 @param col: Upper-left bounding box column coordinate. I{(int)} 3283 @param row: Upper-left bounding box row coordinate. I{(int)} 3284 @param width: Bounding box width (number of columns). I{(int)} 3285 @param height: Bounding box height (number of rows). I{(int)} 3286 @param value: Value to be entered. I{(float)} 3287 @return: The number of filled values. I{(int)} 3288 """ 3289 return None
3290
3291 - def circular_area_fill(col, row, radius, value):
3292 """ 3293 Fills an elliptic region of a data field with given value. 3294 3295 3296 @param col: Row index of circular area centre. I{(int)} 3297 @param row: Column index of circular area centre. I{(int)} 3298 @param radius: Circular area radius (in pixels). Any value is allowed, although 3299 to get areas that do not deviate from true circles after 3300 pixelization too much, half-integer values are recommended, 3301 integer values are NOT recommended. I{(float)} 3302 @param value: Value to be entered. I{(float)} 3303 @return: The number of filled values. I{(int)} 3304 """ 3305 return None
3306
3307 - def normalize():
3308 """ 3309 Normalizes data in a data field to range 0.0 to 1.0. 3310 3311 It is equivalent to L{DataField.renormalize}(B{C{data_field}}, 1.0, 0.0); 3312 3313 If B{C{data_field}} is filled with only one value, it is changed to 0.0. 3314 3315 """ 3316 pass
3317
3318 - def renormalize(range, offset):
3319 """ 3320 Transforms data in a data field with linear function to given range. 3321 3322 When B{C{range}} is positive, the new data range is (B{C{offset}}, B{C{offset}}+B{C{range}}); 3323 when B{C{range}} is negative, the new data range is (B{C{offset}}-B{C{range}}, B{C{offset}}). 3324 In neither case the data are flipped, negative range only means different 3325 selection of boundaries. 3326 3327 When B{C{range}} is zero, this method is equivalent to 3328 L{DataField.fill}(B{C{data_field}}, B{C{offset}}). 3329 3330 @param range: New data interval size. I{(float)} 3331 @param offset: New data interval offset. I{(float)} 3332 """ 3333 pass
3334
3335 - def area_renormalize(col, row, width, height, range, offset):
3336 """ 3337 Transforms data in a part of a data field with linear function to given 3338 range. 3339 3340 When B{C{range}} is positive, the new data range is (B{C{offset}}, B{C{offset}}+B{C{range}}); 3341 when B{C{range}} is negative, the new data range is (B{C{offset}}-B{C{range}}, B{C{offset}}). 3342 In neither case the data are flipped, negative range only means different 3343 selection of boundaries. 3344 3345 When B{C{range}} is zero, this method is equivalent to 3346 L{DataField.fill}(B{C{data_field}}, B{C{offset}}). 3347 3348 @since: 2.45 3349 3350 @param col: Upper-left column coordinate. I{(int)} 3351 @param row: Upper-left row coordinate. I{(int)} 3352 @param width: Area width (number of columns). I{(int)} 3353 @param height: Area height (number of rows). I{(int)} 3354 @param range: New data interval size. I{(float)} 3355 @param offset: New data interval offset. I{(float)} 3356 """ 3357 pass
3358
3359 - def threshold(threshval, bottom, top):
3360 """ 3361 Tresholds values of a data field. 3362 3363 Values smaller than B{C{threshold}} are set to value B{C{bottom}}, values higher 3364 than B{C{threshold}} or equal to it are set to value B{C{top}} 3365 3366 3367 @param threshval: Threshold value. I{(float)} 3368 @param bottom: Lower replacement value. I{(float)} 3369 @param top: Upper replacement value. I{(float)} 3370 @return: The total number of values above threshold. I{(int)} 3371 """ 3372 return None
3373
3374 - def area_threshold(col, row, width, height, threshval, bottom, top):
3375 """ 3376 Tresholds values of a rectangular part of a data field. 3377 3378 Values smaller than B{C{threshold}} are set to value B{C{bottom}}, values higher 3379 than B{C{threshold}} or equal to it are set to value B{C{top}} 3380 3381 3382 @param col: Upper-left column coordinate. I{(int)} 3383 @param row: Upper-left row coordinate. I{(int)} 3384 @param width: Area width (number of columns). I{(int)} 3385 @param height: Area height (number of rows). I{(int)} 3386 @param threshval: Threshold value. I{(float)} 3387 @param bottom: Lower replacement value. I{(float)} 3388 @param top: Upper replacement value. I{(float)} 3389 @return: The total number of values above threshold. I{(int)} 3390 """ 3391 return None
3392
3393 - def clamp(bottom, top):
3394 """ 3395 Limits data field values to a range. 3396 3397 3398 @param bottom: Lower limit value. I{(float)} 3399 @param top: Upper limit value. I{(float)} 3400 @return: The number of changed values, i.e., values that were outside 3401 [B{C{bottom}}, B{C{top}}]. I{(int)} 3402 """ 3403 return None
3404
3405 - def area_clamp(col, row, width, height, bottom, top):
3406 """ 3407 Limits values in a rectangular part of a data field to a range. 3408 3409 3410 @param col: Upper-left column coordinate. I{(int)} 3411 @param row: Upper-left row coordinate. I{(int)} 3412 @param width: Area width (number of columns). I{(int)} 3413 @param height: Area height (number of rows). I{(int)} 3414 @param bottom: Lower limit value. I{(float)} 3415 @param top: Upper limit value. I{(float)} 3416 @return: The number of changed values, i.e., values that were outside 3417 [B{C{bottom}}, B{C{top}}]. I{(int)} 3418 """ 3419 return None
3420
3421 - def area_gather(result, buffer, hsize, vsize, average, col, row, width, height):
3422 """ 3423 Sums or averages values in reactangular areas around each sample in a data 3424 field. 3425 3426 When the gathered area extends out of calculation area, only samples from 3427 their intersection are taken into the local sum (or average). 3428 3429 There are no restrictions on values of B{C{hsize}} and B{C{vsize}} with regard to 3430 B{C{width}} and B{C{height}}, but they have to be positive. 3431 3432 The result is calculated by the means of two-dimensional rolling sums. 3433 One one hand it means the calculation time depends linearly on 3434 (B{C{width}} + B{C{hsize}})*(B{C{height}} + B{C{vsize}}) instead of 3435 B{C{width}}*B{C{hsize}}*B{C{height}}*B{C{vsize}}. On the other hand it means absolute rounding 3436 errors of all output values are given by the largest input values, that is 3437 relative precision of results small in absolute value may be poor. 3438 3439 @param result: A data field to put the result to, it may be B{C{data_field}} itself. I{(L{DataField})} 3440 @param buffer: A data field to use as a scratch area, its size must be at least 3441 B{C{width}}*B{C{height}}. May be B{C{None}} to allocate a private temporary 3442 buffer. I{(L{DataField})} 3443 @param hsize: Horizontal size of gathered area. The area is centered around 3444 each sample if B{C{hsize}} is odd, it extends one pixel more to the 3445 right if B{C{hsize}} is even. I{(int)} 3446 @param vsize: Vertical size of gathered area. The area is centered around 3447 each sample if B{C{vsize}} is odd, it extends one pixel more down 3448 if B{C{vsize}} is even. I{(int)} 3449 @param average: B{C{True}} to divide resulting sums by the number of involved samples 3450 to get averages instead of sums. I{(bool)} 3451 @param col: Upper-left column coordinate. I{(int)} 3452 @param row: Upper-left row coordinate. I{(int)} 3453 @param width: Area width (number of columns). I{(int)} 3454 @param height: Area height (number of rows). I{(int)} 3455 """ 3456 pass
3457
3458 - def convolve(kernel_field):
3459 """ 3460 Convolves a data field with given kernel. 3461 3462 @param kernel_field: Kenrel field to convolve B{C{data_field}} with. I{(L{DataField})} 3463 """ 3464 pass
3465
3466 - def area_convolve(kernel_field, col, row, width, height):
3467 """ 3468 Convolves a rectangular part of a data field with given kernel. 3469 3470 @param kernel_field: Kenrel field to convolve B{C{data_field}} with. I{(L{DataField})} 3471 @param col: Upper-left column coordinate. I{(int)} 3472 @param row: Upper-left row coordinate. I{(int)} 3473 @param width: Area width (number of columns). I{(int)} 3474 @param height: Area height (number of rows). I{(int)} 3475 """ 3476 pass
3477
3478 - def area_ext_convolve(col, row, width, height, target, kernel, exterior, fill_value, as_integral):
3479 """ 3480 Convolve a field with a two-dimensional kernel. 3481 3482 Pixel dimensions of B{C{target}} may match either B{C{field}} or just the rectangular 3483 area. In the former case the result is written in the same rectangular 3484 area; in the latter case the result fills the entire B{C{target}}. 3485 3486 The convolution is performed with the kernel centred on the respective field 3487 pixels. For directions in which the kernel has an odd size this holds 3488 precisely. For an even-sized kernel this means the kernel centre is placed 3489 0.5 pixel left or up (towards lower indices) from the respective field 3490 pixel. 3491 3492 See L{DataField.extend}() for what constitutes the exterior and how it is 3493 handled. 3494 3495 If B{C{as_integral}} is B{C{False}} the function performs a simple discrete 3496 convolution sum and the value units of B{C{target}} are set to product of B{C{field}} 3497 and B{C{kernel}} units. 3498 3499 If B{C{as_integral}} is B{C{True}} the function approximates a convolution integral. 3500 In this case B{C{kernel}} should be a sampled continuous transfer function. 3501 The units of value B{C{target}} are set to product of B{C{field}} and B{C{kernel}} value 3502 units and B{C{field}} lateral units squared. Furthermore, the discrete sum is 3503 multiplied by the pixel size (i.e. dB{C{x}} dB{C{y}} in the integral). 3504 3505 In either case, the lateral units and pixel size of B{C{kernel}} are assumed to 3506 be the same as for B{C{field}} (albeit not checked), because the convolution does 3507 not make sense otherwise. 3508 3509 @since: 2.49 3510 3511 @param col: Upper-left column coordinate. I{(int)} 3512 @param row: Upper-left row coordinate. I{(int)} 3513 @param width: Area width (number of columns). I{(int)} 3514 @param height: Area height (number of rows). I{(int)} 3515 @param target: A two-dimensional data field where the result will be placed. 3516 It may be B{C{field}} for an in-place modification. I{(L{DataField})} 3517 @param kernel: Kernel to convolve B{C{field}} with. I{(L{DataField})} 3518 @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})} 3519 @param fill_value: The value to use with B{C{EXTERIOR_FIXED_VALUE}} exterior. I{(float)} 3520 @param as_integral: B{C{True}} for normalisation and units as a convolution integral, 3521 B{C{False}} as a sum. I{(bool)} 3522 """ 3523 pass
3524
3525 - def convolve_1d(kernel_line, orientation):
3526 """ 3527 Convolves a data field with given linear kernel. 3528 3529 @since: 2.4 3530 3531 @param kernel_line: Kenrel line to convolve B{C{data_field}} with. I{(L{DataLine})} 3532 @param orientation: Filter orientation (see L{DataField.area_convolve_1d}()). Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3533 """ 3534 pass
3535
3536 - def area_convolve_1d(kernel_line, orientation, col, row, width, height):
3537 """ 3538 Convolves a rectangular part of a data field with given linear kernel. 3539 3540 For large separable kernels it can be more efficient to use a sequence of 3541 horizontal and vertical convolutions instead one 2D convolution. 3542 3543 @since: 2.4 3544 3545 @param kernel_line: Kernel line to convolve B{C{data_field}} with. I{(L{DataLine})} 3546 @param orientation: Filter orientation (B{C{ORIENTATION_HORIZONTAL}} for 3547 row-wise convolution, B{C{ORIENTATION_VERTICAL}} for 3548 column-wise convolution). Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3549 @param col: Upper-left column coordinate. I{(int)} 3550 @param row: Upper-left row coordinate. I{(int)} 3551 @param width: Area width (number of columns). I{(int)} 3552 @param height: Area height (number of rows). I{(int)} 3553 """ 3554 pass
3555
3556 - def area_ext_row_convolve(col, row, width, height, target, kernel, exterior, fill_value, as_integral):
3557 """ 3558 Convolve a field row-wise with a one-dimensional kernel. 3559 3560 Pixel dimensions of B{C{target}} may match either B{C{field}} or just the rectangular 3561 area. In the former case the result is written in the same rectangular 3562 area; in the latter case the result fills the entire B{C{target}}. 3563 3564 The convolution is performed with the kernel centred on the respective field 3565 pixels. For an odd-sized kernel this holds precisely. For an even-sized 3566 kernel this means the kernel centre is placed 0.5 pixel to the left 3567 (towards lower column indices) from the respective field pixel. 3568 3569 See L{DataField.extend}() for what constitutes the exterior and how it is 3570 handled. 3571 3572 If B{C{as_integral}} is B{C{False}} the function performs a simple discrete 3573 convolution sum and the value units of B{C{target}} are set to product of B{C{field}} 3574 and B{C{kernel}} units. 3575 3576 If B{C{as_integral}} is B{C{True}} the function approximates a convolution integral. 3577 In this case B{C{kernel}} should be a sampled continuous transfer function. 3578 The units of value B{C{target}} are set to product of B{C{field}} and B{C{kernel}} value 3579 units and B{C{field}} lateral units. Furthermore, the discrete sum is multiplied 3580 by the pixel size (i.e. dB{C{x}} in the integral). 3581 3582 In either case, the lateral units and pixel size of B{C{kernel}} are assumed to 3583 be the same as for a B{C{field}}'s row (albeit not checked), because 3584 the convolution does not make sense otherwise. 3585 3586 @since: 2.49 3587 3588 @param col: Upper-left column coordinate. I{(int)} 3589 @param row: Upper-left row coordinate. I{(int)} 3590 @param width: Area width (number of columns). I{(int)} 3591 @param height: Area height (number of rows). I{(int)} 3592 @param target: A two-dimensional data field where the result will be placed. 3593 It may be B{C{field}} for an in-place modification. I{(L{DataField})} 3594 @param kernel: Kernel to convolve B{C{field}} with. I{(L{DataLine})} 3595 @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})} 3596 @param fill_value: The value to use with B{C{EXTERIOR_FIXED_VALUE}} exterior. I{(float)} 3597 @param as_integral: B{C{True}} for normalisation and units as a convolution integral, 3598 B{C{False}} as a sum. I{(bool)} 3599 """ 3600 pass
3601
3602 - def filter_median(size):
3603 """ 3604 Filters a data field with median filter. 3605 3606 @param size: Size of area to take median of. I{(int)} 3607 """ 3608 pass
3609
3610 - def area_filter_median(size, col, row, width, height):
3611 """ 3612 Filters a rectangular part of a data field with median filter. 3613 3614 @param size: Size of area to take median of. I{(int)} 3615 @param col: Upper-left column coordinate. I{(int)} 3616 @param row: Upper-left row coordinate. I{(int)} 3617 @param width: Area width (number of columns). I{(int)} 3618 @param height: Area height (number of rows). I{(int)} 3619 """ 3620 pass
3621
3622 - def filter_mean(size):
3623 """ 3624 Filters a data field with mean filter of size B{C{size}}. 3625 3626 @param size: Averaged area size. I{(int)} 3627 """ 3628 pass
3629
3630 - def area_filter_mean(size, col, row, width, height):
3631 """ 3632 Filters a rectangular part of a data field with mean filter of size B{C{size}}. 3633 3634 This method is a simple L{DataField.area_gather}() wrapper. 3635 3636 @param size: Averaged area size. I{(int)} 3637 @param col: Upper-left column coordinate. I{(int)} 3638 @param row: Upper-left row coordinate. I{(int)} 3639 @param width: Area width (number of columns). I{(int)} 3640 @param height: Area height (number of rows). I{(int)} 3641 """ 3642 pass
3643
3644 - def filter_conservative(size):
3645 """ 3646 Filters a data field with conservative denoise filter. 3647 3648 @param size: Filtered area size. I{(int)} 3649 """ 3650 pass
3651
3652 - def area_filter_conservative(size, col, row, width, height):
3653 """ 3654 Filters a rectangular part of a data field with conservative denoise filter. 3655 3656 @param size: Filtered area size. I{(int)} 3657 @param col: Upper-left column coordinate. I{(int)} 3658 @param row: Upper-left row coordinate. I{(int)} 3659 @param width: Area width (number of columns). I{(int)} 3660 @param height: Area height (number of rows). I{(int)} 3661 """ 3662 pass
3663
3664 - def filter_laplacian():
3665 """ 3666 Filters a data field with Laplacian filter. 3667 3668 """ 3669 pass
3670
3671 - def area_filter_laplacian(col, row, width, height):
3672 """ 3673 Filters a rectangular part of a data field with Laplacian filter. 3674 3675 @param col: Upper-left column coordinate. I{(int)} 3676 @param row: Upper-left row coordinate. I{(int)} 3677 @param width: Area width (number of columns). I{(int)} 3678 @param height: Area height (number of rows). I{(int)} 3679 """ 3680 pass
3681
3683 """ 3684 Filters a data field with Laplacian of Gaussians filter. 3685 3686 @since: 2.23 3687 3688 """ 3689 pass
3690
3691 - def area_filter_laplacian_of_gaussians(col, row, width, height):
3692 """ 3693 Filters a rectangular part of a data field 3694 with Laplacian of Gaussians filter. 3695 3696 @since: 2.23 3697 3698 @param col: Upper-left column coordinate. I{(int)} 3699 @param row: Upper-left row coordinate. I{(int)} 3700 @param width: Area width (number of columns). I{(int)} 3701 @param height: Area height (number of rows). I{(int)} 3702 """ 3703 pass
3704
3705 - def filter_sobel(orientation):
3706 """ 3707 Filters a data field with a directional Sobel filter. 3708 3709 @param orientation: Filter orientation. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3710 """ 3711 pass
3712
3713 - def area_filter_sobel(orientation, col, row, width, height):
3714 """ 3715 Filters a rectangular part of a data field with a directional Sobel filter. 3716 3717 @param orientation: Filter orientation. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3718 @param col: Upper-left column coordinate. I{(int)} 3719 @param row: Upper-left row coordinate. I{(int)} 3720 @param width: Area width (number of columns). I{(int)} 3721 @param height: Area height (number of rows). I{(int)} 3722 """ 3723 pass
3724
3725 - def filter_sobel_total():
3726 """ 3727 Filters a data field with total Sobel filter. 3728 3729 @since: 2.31 3730 3731 """ 3732 pass
3733
3734 - def filter_prewitt(orientation):
3735 """ 3736 Filters a data field with Prewitt filter. 3737 3738 @param orientation: Filter orientation. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3739 """ 3740 pass
3741
3742 - def area_filter_prewitt(orientation, col, row, width, height):
3743 """ 3744 Filters a rectangular part of a data field with a directional Prewitt 3745 filter. 3746 3747 @param orientation: Filter orientation. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 3748 @param col: Upper-left column coordinate. I{(int)} 3749 @param row: Upper-left row coordinate. I{(int)} 3750 @param width: Area width (number of columns). I{(int)} 3751 @param height: Area height (number of rows). I{(int)} 3752 """ 3753 pass
3754
3755 - def filter_prewitt_total():
3756 """ 3757 Filters a data field with total Prewitt filter. 3758 3759 @since: 2.31 3760 3761 """ 3762 pass
3763
3764 - def filter_slope(xder, yder):
3765 """ 3766 Calculates x and y derivaties for an entire field. 3767 3768 The derivatives are calculated as the simple symmetrical differences (in 3769 physical units, not pixel-wise), except at the edges where the differences 3770 are one-sided. 3771 3772 @since: 2.37 3773 3774 @param xder: Data field where the x-derivarive is to be stored, or B{C{None}} if you 3775 are only interested in the y-derivarive. I{(L{DataField})} 3776 @param yder: Data field where the y-derivarive is to be stored, or B{C{None}} if you 3777 are only interested in the x-derivarive. I{(L{DataField})} 3778 """ 3779 pass
3780
3781 - def filter_dechecker():
3782 """ 3783 Filters a data field with 5x5 checker pattern removal filter. 3784 3785 @since: 2.1 3786 3787 """ 3788 pass
3789
3790 - def area_filter_dechecker(col, row, width, height):
3791 """ 3792 Filters a rectangular part of a data field with 5x5 checker pattern removal 3793 filter. 3794 3795 @since: 2.1 3796 3797 @param col: Upper-left column coordinate. I{(int)} 3798 @param row: Upper-left row coordinate. I{(int)} 3799 @param width: Area width (number of columns). I{(int)} 3800 @param height: Area height (number of rows). I{(int)} 3801 """ 3802 pass
3803
3804 - def filter_gaussian(sigma):
3805 """ 3806 Filters a data field with a Gaussian filter. 3807 3808 @since: 2.4 3809 3810 @param sigma: The sigma parameter of the Gaussian. I{(float)} 3811 """ 3812 pass
3813
3814 - def area_filter_gaussian(sigma, col, row, width, height):
3815 """ 3816 Filters a rectangular part of a data field with a Gaussian filter. 3817 3818 The Gausian is normalized, i.e. it is sum-preserving. 3819 3820 @since: 2.4 3821 3822 @param sigma: The sigma parameter of the Gaussian. I{(float)} 3823 @param col: Upper-left column coordinate. I{(int)} 3824 @param row: Upper-left row coordinate. I{(int)} 3825 @param width: Area width (number of columns). I{(int)} 3826 @param height: Area height (number of rows). I{(int)} 3827 """ 3828 pass
3829
3830 - def filter_minimum(size):
3831 """ 3832 Filters a data field with minimum filter. 3833 3834 @param size: Neighbourhood size for minimum search. I{(int)} 3835 """ 3836 pass
3837
3838 - def area_filter_minimum(size, col, row, width, height):
3839 """ 3840 Filters a rectangular part of a data field with minimum filter. 3841 3842 This operation is often called erosion filter. 3843 3844 @param size: Neighbourhood size for minimum search. I{(int)} 3845 @param col: Upper-left column coordinate. I{(int)} 3846 @param row: Upper-left row coordinate. I{(int)} 3847 @param width: Area width (number of columns). I{(int)} 3848 @param height: Area height (number of rows). I{(int)} 3849 """ 3850 pass
3851
3852 - def filter_maximum(size):
3853 """ 3854 Filters a data field with maximum filter. 3855 3856 @param size: Neighbourhood size for maximum search. I{(int)} 3857 """ 3858 pass
3859
3860 - def area_filter_maximum(size, col, row, width, height):
3861 """ 3862 Filters a rectangular part of a data field with maximum filter. 3863 3864 This operation is often called dilation filter. 3865 3866 @param size: Neighbourhood size for maximum search. I{(int)} 3867 @param col: Upper-left column coordinate. I{(int)} 3868 @param row: Upper-left row coordinate. I{(int)} 3869 @param width: Area width (number of columns). I{(int)} 3870 @param height: Area height (number of rows). I{(int)} 3871 """ 3872 pass
3873
3874 - def area_filter_min_max(kernel, filtertype, col, row, width, height):
3875 """ 3876 Applies a morphological operation with a flat structuring element to a 3877 part of a data field. 3878 3879 Morphological operations with flat structuring elements can be expressed 3880 using minimum (erosion) and maximum (dilation) filters that are the basic 3881 operations this function can perform. 3882 3883 The kernel field is a mask that defines the shape of the flat structuring 3884 element. It is reflected for all maximum operations (dilation). For 3885 symmetrical kernels this does not matter. You can use 3886 L{DataField.elliptic_area_fill}() to create a true circular (or 3887 elliptical) kernel. 3888 3889 The kernel is implicitly centered, i.e. it will be applied symmetrically to 3890 avoid unexpected data movement. Even-sized kernels (generally not 3891 recommended) will extend farther towards the top left image corner for 3892 minimum (erosion) and towards the bottom right corner for maximum (dilation) 3893 operations due to the reflection. If you need off-center structuring 3894 elements you can add empty rows or columns to one side of the kernel to 3895 counteract the symmetrisation. 3896 3897 The operation is linear-time in kernel size for any convex kernel. Note 3898 L{DataField.area_filter_minimum}() and 3899 L{DataField.area_filter_maximum}(), which are limited to square 3900 structuring elements, are much faster for large sizes of the squares. 3901 3902 The exterior is always handled as B{C{EXTERIOR_BORDER_EXTEND}}. 3903 3904 @since: 2.43 3905 3906 @param kernel: Data field defining the flat structuring element. I{(L{DataField})} 3907 @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})} 3908 @param col: Upper-left column coordinate. I{(int)} 3909 @param row: Upper-left row coordinate. I{(int)} 3910 @param width: Area width (number of columns). I{(int)} 3911 @param height: Area height (number of rows). I{(int)} 3912 """ 3913 pass
3914
3915 - def area_filter_disc_asf(radius, closing, col, row, width, height):
3916 """ 3917 Applies an alternating sequential morphological filter with a flat disc 3918 structuring element to a part of a data field. 3919 3920 Alternating sequential filter is a filter consisting of repeated opening and 3921 closing (or closing and opening) with progressively larger structuring 3922 elements. This function performs such filtering for sequence of structuring 3923 elements consisting of true Euclidean discs with increasing radii. The 3924 largest disc in the sequence fits into a (2B{C{size}} + 1) × (2B{C{size}} + 1) square. 3925 3926 @since: 2.43 3927 3928 @param radius: Maximum radius of the circular structuring element, in pixels. 3929 For radius 0 and smaller the filter is no-op. I{(int)} 3930 @param closing: B{C{True}} requests an opening-closing filter (i.e. ending with 3931 closing), B{C{False}} requests a closing-opening filter (i.e. ending 3932 with opening). I{(bool)} 3933 @param col: Upper-left column coordinate. I{(int)} 3934 @param row: Upper-left row coordinate. I{(int)} 3935 @param width: Area width (number of columns). I{(int)} 3936 @param height: Area height (number of rows). I{(int)} 3937 """ 3938 pass
3939
3940 - def filter_rms(size):
3941 """ 3942 Filters a data field with RMS filter. 3943 3944 @param size: Area size. I{(int)} 3945 """ 3946 pass
3947
3948 - def area_filter_rms(size, col, row, width, height):
3949 """ 3950 Filters a rectangular part of a data field with RMS filter of size B{C{size}}. 3951 3952 RMS filter computes root mean square in given area. 3953 3954 @param size: Area size. I{(int)} 3955 @param col: Upper-left column coordinate. I{(int)} 3956 @param row: Upper-left row coordinate. I{(int)} 3957 @param width: Area width (number of columns). I{(int)} 3958 @param height: Area height (number of rows). I{(int)} 3959 """ 3960 pass
3961
3962 - def filter_kuwahara():
3963 """ 3964 Filters a data field with Kuwahara filter. 3965 3966 """ 3967 pass
3968
3969 - def area_filter_kuwahara(col, row, width, height):
3970 """ 3971 Filters a rectangular part of a data field with a Kuwahara 3972 (edge-preserving smoothing) filter. 3973 3974 @param col: Upper-left column coordinate. I{(int)} 3975 @param row: Upper-left row coordinate. I{(int)} 3976 @param width: Area width (number of columns). I{(int)} 3977 @param height: Area height (number of rows). I{(int)} 3978 """ 3979 pass
3980
3981 - def filter_canny(threshold):
3982 """ 3983 Filters a rectangular part of a data field with canny edge detector filter. 3984 3985 @param threshold: Slope detection threshold (range 0..1). I{(float)} 3986 """ 3987 pass
3988
3989 - def shade(target_field, theta, phi):
3990 """ 3991 Shades a data field. 3992 3993 @param target_field: A data field to put the shade to. It will be resized to 3994 match B{C{data_field}}. I{(L{DataField})} 3995 @param theta: Shading angle (in radians, from north pole). I{(float)} 3996 @param phi: Shade orientation in xy plane (in radians, counterclockwise). I{(float)} 3997 """ 3998 pass
3999
4000 - def filter_harris(y_gradient, result, neighbourhood, alpha):
4001 """ 4002 Applies Harris corner detection filter to a pair of gradient data fields. 4003 4004 All passed data field must have the same size. 4005 4006 @param y_gradient: Data field with pre-calculated vertical derivative. I{(L{DataField})} 4007 @param result: Data field for the result. I{(L{DataField})} 4008 @param neighbourhood: Neighbourhood size. I{(int)} 4009 @param alpha: Sensitivity paramter (the squared trace is multiplied by it). I{(float)} 4010 """ 4011 pass
4012
4013 - def fractal_partitioning(xresult, yresult, interpolation):
4014 """ 4015 Computes data for log-log plot by partitioning. 4016 4017 Data lines B{C{xresult}} and B{C{yresult}} will be resized to the output size and 4018 they will contain corresponding values at each position. 4019 4020 @param xresult: Data line to store x-values for log-log plot to. I{(L{DataLine})} 4021 @param yresult: Data line to store y-values for log-log plot to. I{(L{DataLine})} 4022 @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})} 4023 """ 4024 pass
4025
4026 - def fractal_cubecounting(xresult, yresult, interpolation):
4027 """ 4028 Computes data for log-log plot by cube counting. 4029 4030 Data lines B{C{xresult}} and B{C{yresult}} will be resized to the output size and 4031 they will contain corresponding values at each position. 4032 4033 @param xresult: Data line to store x-values for log-log plot to. I{(L{DataLine})} 4034 @param yresult: Data line to store y-values for log-log plot to. I{(L{DataLine})} 4035 @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})} 4036 """ 4037 pass
4038
4039 - def fractal_triangulation(xresult, yresult, interpolation):
4040 """ 4041 Computes data for log-log plot by triangulation. 4042 4043 Data lines B{C{xresult}} and B{C{yresult}} will be resized to the output size and 4044 they will contain corresponding values at each position. 4045 4046 @param xresult: Data line to store x-values for log-log plot to. I{(L{DataLine})} 4047 @param yresult: Data line to store y-values for log-log plot to. I{(L{DataLine})} 4048 @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})} 4049 """ 4050 pass
4051
4052 - def fractal_psdf(xresult, yresult, interpolation):
4053 """ 4054 Computes data for log-log plot by spectral density method. 4055 4056 Data lines B{C{xresult}} and B{C{yresult}} will be resized to the output size and 4057 they will contain corresponding values at each position. 4058 4059 @param xresult: Data line to store x-values for log-log plot to. I{(L{DataLine})} 4060 @param yresult: Data line to store y-values for log-log plot to. I{(L{DataLine})} 4061 @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})} 4062 """ 4063 pass
4064
4065 - def fractal_correction(mask_field, interpolation):
4066 """ 4067 Replaces data under mask with interpolated values using fractal 4068 interpolation. 4069 4070 @param mask_field: Mask of places to be corrected. I{(L{DataField})} 4071 @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})} 4072 """ 4073 pass
4074
4075 - def grains_mark_curvature(grain_field, threshval, below):
4076 """ 4077 Marks data that are above/below curvature threshold. 4078 4079 @param grain_field: Data field to store the resulting mask to. I{(L{DataField})} 4080 @param threshval: Relative curvature threshold, in percents. I{(float)} 4081 @param below: If B{C{True}}, data below threshold are marked, otherwise data above 4082 threshold are marked. I{(bool)} 4083 """ 4084 pass
4085
4086 - def grains_mark_watershed(grain_field, locate_steps, locate_thresh, locate_dropsize, wshed_steps, wshed_dropsize, prefilter, below):
4087 """ 4088 Performs watershed algorithm. 4089 4090 @param grain_field: Result of marking (mask). I{(L{DataField})} 4091 @param locate_steps: Locating algorithm steps. I{(int)} 4092 @param locate_thresh: Locating algorithm threshold. I{(int)} 4093 @param locate_dropsize: Locating drop size. I{(float)} 4094 @param wshed_steps: Watershed steps. I{(int)} 4095 @param wshed_dropsize: Watershed drop size. I{(float)} 4096 @param prefilter: Use prefiltering. I{(bool)} 4097 @param below: If B{C{True}}, valleys are marked, otherwise mountains are marked. I{(bool)} 4098 """ 4099 pass
4100
4101 - def grains_remove_grain(col, row):
4102 """ 4103 Removes one grain at given position. 4104 4105 4106 @param col: Column inside a grain. I{(int)} 4107 @param row: Row inside a grain. I{(int)} 4108 @return: B{C{True}} if a grain was actually removed (i.e., (B{C{col}},B{C{row}}) was 4109 inside a grain). I{(bool)} 4110 """ 4111 return None
4112
4113 - def grains_extract_grain(col, row):
4114 """ 4115 Removes all grains except that one at given position. 4116 4117 If there is no grain at (B{C{col}}, B{C{row}}), all grains are removed. 4118 4119 4120 @param col: Column inside a grain. I{(int)} 4121 @param row: Row inside a grain. I{(int)} 4122 @return: B{C{True}} if a grain remained (i.e., (B{C{col}},B{C{row}}) was inside a grain). I{(bool)} 4123 """ 4124 return None
4125
4126 - def grains_remove_by_number(number):
4127 """ 4128 Removes grain identified by B{C{number}}. 4129 4130 @since: 2.35 4131 4132 @param number: Grain number was filled by L{DataField.number_grains}(). I{(int)} 4133 """ 4134 pass
4135
4136 - def grains_remove_by_size(size):
4137 """ 4138 Removes all grains below specified area. 4139 4140 @param size: Grain area threshold, in square pixels. I{(int)} 4141 """ 4142 pass
4143
4144 - def grains_remove_by_height(grain_field, threshval, below):
4145 """ 4146 Removes grains that are higher/lower than given threshold value. 4147 4148 @param grain_field: Field of marked grains (mask) I{(L{DataField})} 4149 @param threshval: Relative height threshold, in percents. I{(float)} 4150 @param below: If B{C{True}}, grains below threshold are removed, otherwise grains above 4151 threshold are removed. I{(bool)} 4152 """ 4153 pass
4154
4156 """ 4157 Removes all grains that touch field borders. 4158 4159 @since: 2.30 4160 4161 """ 4162 pass
4163
4164 - def grains_watershed_init(grain_field, locate_steps, locate_thresh, locate_dropsize, wshed_steps, wshed_dropsize, prefilter, below):
4165 """ 4166 Initializes the watershed algorithm. 4167 4168 This iterator reports its state as B{C{WatershedStateType}}. 4169 4170 4171 @param grain_field: Result of marking (mask). I{(L{DataField})} 4172 @param locate_steps: Locating algorithm steps. I{(int)} 4173 @param locate_thresh: Locating algorithm threshold. I{(int)} 4174 @param locate_dropsize: Locating drop size. I{(float)} 4175 @param wshed_steps: Watershed steps. I{(int)} 4176 @param wshed_dropsize: Watershed drop size. I{(float)} 4177 @param prefilter: Use prefiltering. I{(bool)} 4178 @param below: If B{C{True}}, valleys are marked, otherwise mountains are marked. I{(bool)} 4179 @return: A new watershed iterator. I{(ComputationState*)} 4180 """ 4181 return None
4182
4183 - def grains_mark_height(grain_field, threshval, below):
4184 """ 4185 Marks data that are above/below height threshold. 4186 4187 @param grain_field: Data field to store the resulting mask to. I{(L{DataField})} 4188 @param threshval: Relative height threshold, in percents. I{(float)} 4189 @param below: If B{C{True}}, data below threshold are marked, otherwise data above 4190 threshold are marked. I{(bool)} 4191 """ 4192 pass
4193
4194 - def grains_mark_slope(grain_field, threshval, below):
4195 """ 4196 Marks data that are above/below slope threshold. 4197 4198 @param grain_field: Data field to store the resulting mask to. I{(L{DataField})} 4199 @param threshval: Relative slope threshold, in percents. I{(float)} 4200 @param below: If B{C{True}}, data below threshold are marked, otherwise data above 4201 threshold are marked. I{(bool)} 4202 """ 4203 pass
4204
4205 - def otsu_threshold():
4206 """ 4207 Finds Otsu's height threshold for a data field. 4208 4209 The Otsu's threshold is optimal in the sense that it minimises the 4210 inter-class variances of two classes of pixels: above and below theshold. 4211 4212 @since: 2.37 4213 4214 @return: I{(float)} 4215 """ 4216 return None
4217
4218 - def grains_add(add_field):
4219 """ 4220 Adds B{C{add_field}} grains to B{C{grain_field}}. 4221 4222 Note: This function is equivalent to 4223 |[ 4224 L{DataField.max_of_fields}(grain_field, grain_field, add_field); 4225 ]| 4226 4227 @param add_field: Field of marked grains (mask) to be added. I{(L{DataField})} 4228 """ 4229 pass
4230
4231 - def grains_intersect(intersect_field):
4232 """ 4233 Performs intersection betweet two grain fields, 4234 result is stored in B{C{grain_field}}. 4235 4236 Note: This function is equivalent to 4237 |[ 4238 L{DataField.min_of_fields}(grain_field, grain_field, intersect_field); 4239 ]| 4240 4241 @param intersect_field: Field of marked grains (mask). I{(L{DataField})} 4242 """ 4243 pass
4244
4245 - def grains_invert():
4246 """ 4247 Inverts a data field representing a mask. 4248 4249 All non-positive values are transformed to 1.0. All positive values are 4250 transformed to 0.0. 4251 4252 @since: 2.43 4253 4254 """ 4255 pass
4256
4257 - def grains_autocrop(symmetrically):
4258 """ 4259 Removes empty border rows and columns from a data field representing a mask. 4260 4261 If there are border rows and columns filled completely with non-positive 4262 values the size of the data field is reduced, removing these rows. The 4263 parameter B{C{symmetrically}} controls whether the size reduction is maximum 4264 possible or symmetrical. 4265 4266 When there is no positive value in the field the field size is reduced to 4267 the smallest possible. This means 1x1 for B{C{symmetrical}} being B{C{False}} and 4268 even original dimensions to 2 for B{C{symmetrical}} being B{C{True}}. 4269 4270 @since: 2.43 4271 4272 @param symmetrically: B{C{True}} to remove borders symmetrically, i.e the same number 4273 of pixels from left and right, and also top and bottom. 4274 B{C{False}} to remove as many empty rows and columns as possible. I{(bool)} 4275 @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)}) 4276 """ 4277 return None, None, None, None, None
4278
4279 - def area_grains_tgnd(target_line, col, row, width, height, below, nstats):
4280 """ 4281 Calculates threshold grain number distribution. 4282 4283 This function is a simple L{DataField.area_grains_tgnd_range}() that 4284 calculates the distribution in the full range. 4285 4286 @param target_line: A data line to store the distribution to. It will be 4287 resampled to the requested width. I{(L{DataLine})} 4288 @param col: Upper-left column coordinate. I{(int)} 4289 @param row: Upper-left row coordinate. I{(int)} 4290 @param width: Area width (number of columns). I{(int)} 4291 @param height: Area height (number of rows). I{(int)} 4292 @param below: If B{C{True}}, valleys are marked, otherwise mountains are marked. I{(bool)} 4293 @param nstats: The number of samples to take on the distribution function. If 4294 nonpositive, a suitable resolution is determined automatically. I{(int)} 4295 """ 4296 pass
4297
4298 - def area_grains_tgnd_range(target_line, col, row, width, height, min, max, below, nstats):
4299 """ 4300 Calculates threshold grain number distribution in given height range. 4301 4302 This is the number of grains for each of B{C{nstats}} equidistant height 4303 threshold levels. For large B{C{nstats}} this function is much faster than the 4304 equivalent number of L{DataField.grains_mark_height}() calls. 4305 4306 @param target_line: A data line to store the distribution to. It will be 4307 resampled to the requested width. I{(L{DataLine})} 4308 @param col: Upper-left column coordinate. I{(int)} 4309 @param row: Upper-left row coordinate. I{(int)} 4310 @param width: Area width (number of columns). I{(int)} 4311 @param height: Area height (number of rows). I{(int)} 4312 @param min: Minimum threshold value. I{(float)} 4313 @param max: Maximum threshold value. I{(float)} 4314 @param below: If B{C{True}}, valleys are marked, otherwise mountains are marked. I{(bool)} 4315 @param nstats: The number of samples to take on the distribution function. If 4316 nonpositive, a suitable resolution is determined automatically. I{(int)} 4317 """ 4318 pass
4319
4320 - def grains_splash_water(minima, locate_steps, locate_dropsize):
4321 pass
4322
4324 """ 4325 Performs Euclidean distance transform of a data field with grains. 4326 4327 Each non-zero value will be replaced with Euclidean distance to the grain 4328 boundary, measured in pixels. 4329 4330 See also L{DataField.grain_simple_dist_trans}() for simple distance 4331 transforms such as city-block or chessboard. 4332 4333 @since: 2.36 4334 4335 """ 4336 pass
4337
4338 - def grain_simple_dist_trans(dtype, from_border):
4339 """ 4340 Performs a distance transform of a data field with grains. 4341 4342 Each non-zero value will be replaced with a distance to the grain boundary, 4343 measured in pixels. 4344 4345 Note this function can calculate the true Euclidean distance transform 4346 only since 2.43. Use L{DataField.grain_distance_transform}() for the EDT 4347 if you need compatibility with older versions. 4348 4349 @since: 2.41 4350 4351 @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})} 4352 @param from_border: B{C{True}} to consider image edges to be grain boundaries. I{(bool)} 4353 """ 4354 pass
4355
4356 - def grains_shrink(amount, dtype, from_border):
4357 """ 4358 Erodes a data field containing mask by specified amount using a distance 4359 measure. 4360 4361 Non-zero pixels in B{C{data_field}} will be replaced with zeroes if they are not 4362 farther than B{C{amount}} from the grain boundary as defined by B{C{dtype}}. 4363 4364 @since: 2.43 4365 4366 @param amount: How much the grains should be reduced, in pixels. It is inclusive, 4367 i.e. pixels that are B{C{amount}} far from the border will be removed. I{(float)} 4368 @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})} 4369 @param from_border: B{C{True}} to consider image edges to be grain boundaries. 4370 B{C{False}} to reduce grains touching field boundaries only along 4371 the boundaries. I{(bool)} 4372 """ 4373 pass
4374
4375 - def grains_grow(amount, dtype, prevent_merging):
4376 """ 4377 Dilates a data field containing mask by specified amount using a distance 4378 measure. 4379 4380 Non-positive pixels in B{C{data_field}} will be replaced with ones if they are 4381 not farther than B{C{amount}} from the grain boundary as defined by B{C{dtype}}. 4382 4383 @since: 2.43 4384 4385 @param amount: How much the grains should be expanded, in pixels. It is 4386 inclusive, i.e. exterior pixels that are B{C{amount}} far from the 4387 border will be filled. I{(float)} 4388 @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})} 4389 @param prevent_merging: B{C{True}} to prevent grain merging, i.e. the growth stops 4390 where two grains would merge. B{C{False}} to simply expand the 4391 grains, without regard to grain connectivity. I{(bool)} 4392 """ 4393 pass
4394
4395 - def grains_thin():
4396 """ 4397 Performs thinning of a data field containing mask. 4398 4399 The result of thinning is a ‘skeleton’ mask consisting of single-pixel thin 4400 lines. 4401 4402 @since: 2.48 4403 4404 """ 4405 pass
4406
4407 - def fill_voids(nonsimple):
4408 """ 4409 Fills voids in grains in a data field representing a mask. 4410 4411 Voids in grains are zero pixels in B{C{data_field}} from which no path exists 4412 through other zero pixels to the field boundary. The paths are considered 4413 in 8-connectivity because grains themselves are considered in 4414 4-connectivity. 4415 4416 @since: 2.37 4417 4418 @param nonsimple: Pass B{C{True}} to fill also voids that are not simple-connected 4419 (e.g. ring-like). This can result in grain merging if a small 4420 grain is contained within a void. Pass B{C{False}} to fill only 4421 simple-connected grains. I{(bool)} 4422 @return: B{C{True}} if any voids were filled at all, B{C{False}} if no change was 4423 made. I{(bool)} 4424 """ 4425 return None
4426
4427 - def mark_extrema(extrema, maxima):
4428 """ 4429 Marks local maxima or minima in a two-dimensional field. 4430 4431 Local (or regional) maximum is a contiguous set of pixels that have the same 4432 value and this value is sharply greater than the value of any pixel touching 4433 the set. A minimum is defined analogously. A field filled with a single 4434 value is considered to have neither minimum nor maximum. 4435 4436 @since: 2.37 4437 4438 @param extrema: Target field for the extrema mask. I{(L{DataField})} 4439 @param maxima: B{C{True}} to mark maxima, B{C{False}} to mark minima. I{(bool)} 4440 """ 4441 pass
4442
4443 - def hough_line(x_gradient, y_gradient, result, hwidth, overlapping):
4444 pass
4445
4446 - def hough_circle(x_gradient, y_gradient, result, radius):
4447 pass
4448
4449 - def hough_line_strenghten(x_gradient, y_gradient, hwidth, threshold):
4450 pass
4451
4452 - def hough_circle_strenghten(x_gradient, y_gradient, radius, threshold):
4453 pass
4454
4455 - def hough_polar_line_to_datafield(rho, theta):
4456 return None, None, None, None
4457
4458 - def fft1d(iin, rout, iout, orientation, windowing, direction, interpolation, preserverms, level):
4459 """ 4460 Transforms all rows or columns in a data field with Fast Fourier Transform. 4461 4462 If requested a windowing and/or leveling is applied to preprocess data to 4463 obtain reasonable results. 4464 4465 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4466 transform which can be somewhat faster than complex-to-complex 4467 transform. I{(L{DataField})} 4468 @param rout: Real output data field, it will be resized to area size. I{(L{DataField})} 4469 @param iout: Imaginary output data field, it will be resized to area size. I{(L{DataField})} 4470 @param orientation: Orientation: pass B{C{ORIENTATION_HORIZONTAL}} to 4471 transform rows, B{C{ORIENTATION_VERTICAL}} to transform 4472 columns. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 4473 @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})} 4474 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4475 @param interpolation: Interpolation type. 4476 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})} 4477 @param preserverms: B{C{True}} to preserve RMS while windowing. I{(bool)} 4478 @param level: 0 to perform no leveling, 1 to subtract mean value, 2 to subtract 4479 line (the number can be interpreted as the first polynomial degree 4480 to keep, but only the enumerated three values are available). I{(int)} 4481 """ 4482 pass
4483
4484 - def area_1dfft(iin, rout, iout, col, row, width, height, orientation, windowing, direction, interpolation, preserverms, level):
4485 """ 4486 Transforms all rows or columns in a rectangular part of a data field with 4487 Fast Fourier Transform. 4488 4489 If requested a windowing and/or leveling is applied to preprocess data to 4490 obtain reasonable results. 4491 4492 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4493 transform which can be somewhat faster than complex-to-complex 4494 transform. I{(L{DataField})} 4495 @param rout: Real output data field, it will be resized to area size. I{(L{DataField})} 4496 @param iout: Imaginary output data field, it will be resized to area size. I{(L{DataField})} 4497 @param col: Upper-left column coordinate. I{(int)} 4498 @param row: Upper-left row coordinate. I{(int)} 4499 @param width: Area width (number of columns), must be at least 2 for horizontal 4500 transforms. I{(int)} 4501 @param height: Area height (number of rows), must be at least 2 for vertical 4502 transforms. I{(int)} 4503 @param orientation: Orientation: pass B{C{ORIENTATION_HORIZONTAL}} to 4504 transform rows, B{C{ORIENTATION_VERTICAL}} to transform 4505 columns. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 4506 @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})} 4507 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4508 @param interpolation: Interpolation type. 4509 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})} 4510 @param preserverms: B{C{True}} to preserve RMS while windowing. I{(bool)} 4511 @param level: 0 to perform no leveling, 1 to subtract mean value, 2 to subtract 4512 lines (the number can be interpreted as the first polynomial degree 4513 to keep, but only the enumerated three values are available). I{(int)} 4514 """ 4515 pass
4516
4517 - def fft1d_raw(iin, rout, iout, orientation, direction):
4518 """ 4519 Transforms all rows or columns in a data field with Fast Fourier Transform. 4520 4521 No leveling, windowing nor scaling is performed. 4522 4523 Since 2.8 the dimensions need not to be from the set of sizes returned 4524 by L{gwy_fft_find_nice_size}(). 4525 4526 @since: 2.1 4527 4528 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4529 transform. I{(L{DataField})} 4530 @param rout: Real output data field, it will be resized to B{C{rin}} size. I{(L{DataField})} 4531 @param iout: Imaginary output data field, it will be resized to B{C{rin}} size. I{(L{DataField})} 4532 @param orientation: Orientation: pass B{C{ORIENTATION_HORIZONTAL}} to 4533 transform rows, B{C{ORIENTATION_VERTICAL}} to transform 4534 columns. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 4535 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4536 """ 4537 pass
4538
4539 - def fft2d(iin, rout, iout, windowing, direction, interpolation, preserverms, level):
4540 """ 4541 Calculates 2D Fast Fourier Transform of a rectangular a data field. 4542 4543 If requested a windowing and/or leveling is applied to preprocess data to 4544 obtain reasonable results. 4545 4546 Lateral dimensions, offsets and units are unchanged. See 4547 L{DataField.fft_postprocess}() for that. 4548 4549 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4550 transform which can be somewhat faster than complex-to-complex 4551 transform. I{(L{DataField})} 4552 @param rout: Real output data field, it will be resized to area size. I{(L{DataField})} 4553 @param iout: Imaginary output data field, it will be resized to area size. I{(L{DataField})} 4554 @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})} 4555 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4556 @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})} 4557 @param preserverms: B{C{True}} to preserve RMS while windowing. I{(bool)} 4558 @param level: 0 to perform no leveling, 1 to subtract mean value, 2 to subtract 4559 plane (the number can be interpreted as the first polynomial degree 4560 to keep, but only the enumerated three values are available). I{(int)} 4561 """ 4562 pass
4563
4564 - def area_2dfft(iin, rout, iout, col, row, width, height, windowing, direction, interpolation, preserverms, level):
4565 """ 4566 Calculates 2D Fast Fourier Transform of a rectangular area of a data field. 4567 4568 If requested a windowing and/or leveling is applied to preprocess data to 4569 obtain reasonable results. 4570 4571 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4572 transform which can be somewhat faster than complex-to-complex 4573 transform. I{(L{DataField})} 4574 @param rout: Real output data field, it will be resized to area size. I{(L{DataField})} 4575 @param iout: Imaginary output data field, it will be resized to area size. I{(L{DataField})} 4576 @param col: Upper-left column coordinate. I{(int)} 4577 @param row: Upper-left row coordinate. I{(int)} 4578 @param width: Area width (number of columns), must be at least 2. I{(int)} 4579 @param height: Area height (number of rows), must be at least 2. I{(int)} 4580 @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})} 4581 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4582 @param interpolation: Interpolation type. 4583 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})} 4584 @param preserverms: B{C{True}} to preserve RMS while windowing. I{(bool)} 4585 @param level: 0 to perform no leveling, 1 to subtract mean value, 2 to subtract 4586 plane (the number can be interpreted as the first polynomial degree 4587 to keep, but only the enumerated three values are available). I{(int)} 4588 """ 4589 pass
4590
4591 - def fft2d_raw(iin, rout, iout, direction):
4592 """ 4593 Calculates 2D Fast Fourier Transform of a data field. 4594 4595 No leveling, windowing nor scaling is performed. 4596 4597 Since 2.8 the dimensions need not to be from the set of sizes returned 4598 by L{gwy_fft_find_nice_size}(). 4599 4600 Lateral dimensions, offsets and units are unchanged. See 4601 L{DataField.fft_postprocess}() for that. 4602 4603 @since: 2.1 4604 4605 @param iin: Imaginary input data field. It can be B{C{None}} for real-to-complex 4606 transform. I{(L{DataField})} 4607 @param rout: Real output data field, it will be resized to B{C{rin}} size. I{(L{DataField})} 4608 @param iout: Imaginary output data field, it will be resized to B{C{rin}} size. I{(L{DataField})} 4609 @param direction: FFT direction. Expected values: C{B{TRANSFORM_DIRECTION_BACKWARD}}, C{B{TRANSFORM_DIRECTION_FORWARD}}. I{(L{TransformDirection})} 4610 """ 4611 pass
4612
4613 - def fft2d_humanize():
4614 """ 4615 Rearranges 2D FFT output to a human-friendly form. 4616 4617 Top-left, top-right, bottom-left and bottom-right sub-rectangles are swapped 4618 to obtain a humanized 2D FFT output with (0,0) in the centre. 4619 4620 More precisely, for even field dimensions the equally-sized blocks starting 4621 with the Nyquist frequency and with the zero frequency (constant component) 4622 will exchange places. For odd field dimensions, the block containing the 4623 zero frequency is one item larger and the constant component will actually 4624 end up in the exact centre. 4625 4626 Also note if both dimensions are even, this function is involutory and 4627 identical to L{DataField.fft2d_dehumanize}(). However, if any dimension 4628 is odd, L{DataField.fft2d_humanize}() and 4629 L{DataField.fft2d_dehumanize}() are different, therefore they must be 4630 paired properly. 4631 4632 """ 4633 pass
4634
4635 - def fft2d_dehumanize():
4636 """ 4637 Rearranges 2D FFT output back from the human-friendly form. 4638 4639 Top-left, top-right, bottom-left and bottom-right sub-rectangles are swapped 4640 to reshuffle a humanized 2D FFT output back into the natural positions. 4641 4642 See L{DataField.fft2d_humanize}() for discussion. 4643 4644 @since: 2.8 4645 4646 """ 4647 pass
4648
4649 - def fft_postprocess(humanize):
4650 """ 4651 Updates units, dimensions and offsets for a 2D FFT-processed field. 4652 4653 The field is expected to have dimensions and units of the original 4654 direct-space data. The lateral units and resolutions are updated to 4655 correspond to its Fourier transform. 4656 4657 If B{C{humanize}} is B{C{True}} L{DataField.fft2d_humanize}() is applied to the 4658 field data and the lateral offsets are set accordingly. Otherwise the 4659 offsets are cleared. 4660 4661 Value units are kept intact. 4662 4663 @since: 2.38 4664 4665 @param humanize: B{C{True}} to rearrange data to have the frequency origin in the 4666 centre. I{(bool)} 4667 """ 4668 pass
4669
4670 - def fft_filter_1d(result_field, weights, orientation, interpolation):
4671 """ 4672 Performs 1D FFT filtering of a data field. 4673 4674 @param result_field: A data field to store the result to. It will be resampled 4675 to B{C{data_field}}'s size. I{(L{DataField})} 4676 @param weights: Filter weights for the lower half of the spectrum (the other 4677 half is symmetric). Its size can be arbitrary, it will be 4678 interpolated. I{(L{DataLine})} 4679 @param orientation: Filter direction. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 4680 @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})} 4681 """ 4682 pass
4683
4684 - def cwt(interpolation, scale, wtype):
4685 """ 4686 Computes a continuous wavelet transform (CWT) at given 4687 scale and using given wavelet. 4688 4689 @param interpolation: Interpolation type. 4690 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})} 4691 @param scale: Wavelet scale. I{(float)} 4692 @param wtype: Wavelet type. Expected values: C{B{2DCWT_GAUSS}}, C{B{2DCWT_HAT}}. I{(L{2DCWTWaveletType})} 4693 """ 4694 pass
4695
4696 - def area_fit_plane(mask, col, row, width, height):
4697 """ 4698 Fits a plane through a rectangular part of a data field. 4699 4700 The coefficients can be used for plane leveling using the same relation 4701 as in L{DataField.fit_plane}(), counting indices from area top left 4702 corner. 4703 4704 @param mask: Mask of values to take values into account, or B{C{None}} for full 4705 B{C{data_field}}. Values equal to 0.0 and below cause corresponding 4706 B{C{data_field}} samples to be ignored, values equal to 1.0 and above 4707 cause inclusion of corresponding B{C{data_field}} samples. The behaviour 4708 for values inside (0.0, 1.0) is undefined (it may be specified 4709 in the future). I{(L{DataField})} 4710 @param col: Upper-left column coordinate. I{(int)} 4711 @param row: Upper-left row coordinate. I{(int)} 4712 @param width: Area width (number of columns). I{(int)} 4713 @param height: Area height (number of rows). I{(int)} 4714 @return: Tuple consisting of 3 values (B{C{pa}}, B{C{pbx}}, B{C{pby}}). (I{(float)}, I{(float)}, I{(float)}) 4715 """ 4716 return None, None, None
4717
4718 - def fit_plane():
4719 """ 4720 Fits a plane through a data field. 4721 4722 The coefficients can be used for plane leveling using relation 4723 data[i] := data[i] - (pa + pby*i + pbx*j); 4724 4725 @return: Tuple consisting of 3 values (B{C{pa}}, B{C{pbx}}, B{C{pby}}). (I{(float)}, I{(float)}, I{(float)}) 4726 """ 4727 return None, None, None
4728
4729 - def fit_facet_plane(mfield, masking):
4730 """ 4731 Calculates the inclination of a plane close to the dominant plane in a data 4732 field. 4733 4734 The dominant plane is determined by taking into account larger local slopes 4735 with exponentially smaller weight. 4736 4737 This is the basis of so-called facet levelling algorithm. Usually, the 4738 plane found by this method is subtracted using L{DataField.plane_level}() 4739 and the entire process is repeated until it converges. A convergence 4740 criterion may be sufficiently small values of the x and y plane 4741 coefficients. Note that since L{DataField.plane_level}() uses pixel-based 4742 lateral coordinates, the coefficients must be divided by 4743 L{DataField.get_xmeasure}(data_field) and 4744 L{DataField.get_ymeasure}(data_field) to obtain physical plane 4745 coefficients. 4746 4747 @since: 2.37 4748 4749 @param mfield: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 4750 @param masking: Masking mode to use. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 4751 @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)}) 4752 """ 4753 return None, None, None, None
4754
4755 - def plane_level(a, bx, by):
4756 """ 4757 Subtracts plane from a data field. 4758 4759 See L{DataField.fit_plane}() for details. 4760 4761 @param a: Constant coefficient. I{(float)} 4762 @param bx: X plane coefficient. I{(float)} 4763 @param by: Y plane coefficient. I{(float)} 4764 """ 4765 pass
4766
4767 - def plane_rotate(xangle, yangle, interpolation):
4768 """ 4769 Performs rotation of plane along x and y axis. 4770 4771 @param xangle: Rotation angle in x direction (rotation along y axis, in radians). I{(float)} 4772 @param yangle: Rotation angle in y direction (rotation along x axis, in radians). I{(float)} 4773 @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})} 4774 """ 4775 pass
4776
4777 - def fit_lines(col, row, width, height, degree, exclude, orientation):
4778 """ 4779 Independently levels profiles on each row/column in a data field. 4780 4781 Lines that have no intersection with area selected by B{C{ulcol}}, B{C{ulrow}}, 4782 B{C{brcol}}, B{C{brrow}} are always leveled as a whole. Lines that have intersection 4783 with selected area, are leveled using polynomial coefficients computed only 4784 from data inside (or outside for B{C{exclude}} = B{C{True}}) the area. 4785 4786 @param col: Upper-left column coordinate. I{(int)} 4787 @param row: Upper-left row coordinate. I{(int)} 4788 @param width: Area width (number of columns). I{(int)} 4789 @param height: Area height (number of rows). I{(int)} 4790 @param degree: Fitted polynomial degree. I{(int)} 4791 @param exclude: If B{C{True}}, outside of area selected by B{C{ulcol}}, B{C{ulrow}}, B{C{brcol}}, 4792 B{C{brrow}} will be used for polynomial coefficients computation, 4793 instead of inside. I{(bool)} 4794 @param orientation: Line orientation. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 4795 """ 4796 pass
4797
4798 - def area_local_plane_quantity(size, col, row, width, height, type, result):
4799 """ 4800 Convenience function to get just one quantity from 4801 L{DataField.area_fit_local_planes}(). 4802 4803 4804 @param size: Neighbourhood size. I{(int)} 4805 @param col: Upper-left column coordinate. I{(int)} 4806 @param row: Upper-left row coordinate. I{(int)} 4807 @param width: Area width (number of columns). I{(int)} 4808 @param height: Area height (number of rows). I{(int)} 4809 @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})} 4810 @param result: A data field to store result to, or B{C{None}} to allocate a new one. I{(L{DataField})} 4811 @return: B{C{result}} if it isn't B{C{None}}, otherwise a newly allocated data field. I{(L{DataField})} 4812 """ 4813 return None
4814
4815 - def local_plane_quantity(size, type, result):
4816 """ 4817 Convenience function to get just one quantity from 4818 L{DataField.fit_local_planes}(). 4819 4820 4821 @param size: Neighbourhood size. I{(int)} 4822 @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})} 4823 @param result: A data field to store result to, or B{C{None}} to allocate a new one. I{(L{DataField})} 4824 @return: B{C{result}} if it isn't B{C{None}}, otherwise a newly allocated data field. I{(L{DataField})} 4825 """ 4826 return None
4827
4828 - def get_max():
4829 """ 4830 Finds the maximum value of a data field. 4831 4832 This quantity is cached. 4833 4834 4835 @return: The maximum value. I{(float)} 4836 """ 4837 return None
4838
4839 - def get_min():
4840 """ 4841 Finds the minimum value of a data field. 4842 4843 This quantity is cached. 4844 4845 4846 @return: The minimum value. I{(float)} 4847 """ 4848 return None
4849
4850 - def get_min_max():
4851 """ 4852 Finds minimum and maximum values of a data field. 4853 4854 @return: Tuple consisting of 2 values (B{C{min}}, B{C{max}}). (I{(float)}, I{(float)}) 4855 """ 4856 return None, None
4857
4858 - def get_avg():
4859 """ 4860 Computes average value of a data field. 4861 4862 This quantity is cached. 4863 4864 4865 @return: The average value. I{(float)} 4866 """ 4867 return None
4868
4869 - def get_rms():
4870 """ 4871 Computes root mean square value of a data field. 4872 4873 This quantity is cached. 4874 4875 4876 @return: The root mean square value. I{(float)} 4877 """ 4878 return None
4879
4880 - def get_sum():
4881 """ 4882 Sums all values in a data field. 4883 4884 This quantity is cached. 4885 4886 4887 @return: The sum of all values. I{(float)} 4888 """ 4889 return None
4890
4891 - def get_median():
4892 """ 4893 Computes median value of a data field. 4894 4895 This quantity is cached. 4896 4897 4898 @return: The median value. I{(float)} 4899 """ 4900 return None
4901
4902 - def get_surface_area():
4903 """ 4904 Computes surface area of a data field. 4905 4906 This quantity is cached. 4907 4908 4909 @return: The surface area. I{(float)} 4910 """ 4911 return None
4912
4913 - def get_variation():
4914 """ 4915 Computes the total variation of a data field. 4916 4917 See L{DataField.area_get_variation}() for the definition. 4918 4919 This quantity is cached. 4920 4921 @since: 2.38 4922 4923 @return: The variation. I{(float)} 4924 """ 4925 return None
4926
4927 - def get_entropy():
4928 """ 4929 Computes the entropy of a data field. 4930 4931 See L{DataField.area_get_entropy}() for the definition. 4932 4933 This quantity is cached. 4934 4935 @since: 2.42 4936 4937 @return: The value distribution entropy. I{(float)} 4938 """ 4939 return None
4940
4941 - def get_entropy_2d(yfield):
4942 """ 4943 Computes the entropy of a two-dimensional point cloud. 4944 4945 Each pair of corresponding B{C{xfield}} and B{C{yfield}} pixels is assumed to 4946 represent the coordinates (B{C{x}},B{C{y}}) of a point in plane. Hence they must have 4947 the same dimensions. 4948 4949 @since: 2.44 4950 4951 @param yfield: A data field containing the B{C{y}}-coordinates. I{(L{DataField})} 4952 @return: The two-dimensional distribution entropy. I{(float)} 4953 """ 4954 return None
4955
4956 - def area_get_max(mask, col, row, width, height):
4957 """ 4958 Finds the maximum value in a rectangular part of a data field. 4959 4960 4961 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 4962 @param col: Upper-left column coordinate. I{(int)} 4963 @param row: Upper-left row coordinate. I{(int)} 4964 @param width: Area width (number of columns). I{(int)} 4965 @param height: Area height (number of rows). I{(int)} 4966 @return: The maximum value. When the number of samples to calculate 4967 maximum of is zero, -B{C{glib.MAXDOUBLE}} is returned. I{(float)} 4968 """ 4969 return None
4970
4971 - def area_get_min(mask, col, row, width, height):
4972 """ 4973 Finds the minimum value in a rectangular part of a data field. 4974 4975 4976 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 4977 @param col: Upper-left column coordinate. I{(int)} 4978 @param row: Upper-left row coordinate. I{(int)} 4979 @param width: Area width (number of columns). I{(int)} 4980 @param height: Area height (number of rows). I{(int)} 4981 @return: The minimum value. When the number of samples to calculate 4982 minimum of is zero, -B{C{glib.MAXDOUBLE}} is returned. I{(float)} 4983 """ 4984 return None
4985
4986 - def area_get_min_max(mask, col, row, width, height):
4987 """ 4988 Finds minimum and maximum values in a rectangular part of a data field. 4989 4990 This function is equivalent to calling 4991 B{C{L{DataField.area_get_min_max_mask}}}() 4992 with masking mode B{C{MASK_INCLUDE}}. 4993 4994 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 4995 @param col: Upper-left column coordinate. I{(int)} 4996 @param row: Upper-left row coordinate. I{(int)} 4997 @param width: Area width (number of columns). I{(int)} 4998 @param height: Area height (number of rows). I{(int)} 4999 @return: Tuple consisting of 2 values (B{C{min}}, B{C{max}}). (I{(float)}, I{(float)}) 5000 """ 5001 return None, None
5002
5003 - def area_get_min_max_mask(mask, mode, col, row, width, height):
5004 """ 5005 Finds minimum and maximum values in a rectangular part of a data field. 5006 5007 @since: 2.18 5008 5009 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5010 @param mode: Masking mode to use. See the introduction for description of 5011 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5012 @param col: Upper-left column coordinate. I{(int)} 5013 @param row: Upper-left row coordinate. I{(int)} 5014 @param width: Area width (number of columns). I{(int)} 5015 @param height: Area height (number of rows). I{(int)} 5016 @return: Tuple consisting of 2 values (B{C{min}}, B{C{max}}). (I{(float)}, I{(float)}) 5017 """ 5018 return None, None
5019
5020 - def area_get_avg(mask, col, row, width, height):
5021 """ 5022 Computes average value of a rectangular part of a data field. 5023 5024 This function is equivalent to calling B{C{L{DataField.area_get_avg_mask}}}() 5025 with masking mode B{C{MASK_INCLUDE}}. 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 average value. I{(float)} 5034 """ 5035 return None
5036
5037 - def area_get_avg_mask(mask, mode, col, row, width, height):
5038 """ 5039 Computes average value of a rectangular part of a data field. 5040 5041 @since: 2.18 5042 5043 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5044 @param mode: Masking mode to use. See the introduction for description of 5045 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5046 @param col: Upper-left column coordinate. I{(int)} 5047 @param row: Upper-left row coordinate. I{(int)} 5048 @param width: Area width (number of columns). I{(int)} 5049 @param height: Area height (number of rows). I{(int)} 5050 @return: The average value. I{(float)} 5051 """ 5052 return None
5053
5054 - def area_get_rms(mask, col, row, width, height):
5055 """ 5056 Computes root mean square value of a rectangular part of a data field. 5057 5058 5059 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5060 @param col: Upper-left column coordinate. I{(int)} 5061 @param row: Upper-left row coordinate. I{(int)} 5062 @param width: Area width (number of columns). I{(int)} 5063 @param height: Area height (number of rows). I{(int)} 5064 @return: The root mean square value. 5065 5066 This function is equivalent to calling B{C{L{DataField.area_get_rms_mask}}}() 5067 with masking mode B{C{MASK_INCLUDE}}. I{(float)} 5068 """ 5069 return None
5070
5071 - def area_get_rms_mask(mask, mode, col, row, width, height):
5072 """ 5073 Computes root mean square value of deviations of a rectangular part of a 5074 data field. 5075 5076 @since: 2.18 5077 5078 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5079 @param mode: Masking mode to use. See the introduction for description of 5080 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 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 root mean square value of deviations from the mean value. I{(float)} 5086 """ 5087 return None
5088
5089 - def area_get_grainwise_rms(mask, mode, col, row, width, height):
5090 """ 5091 Computes grain-wise root mean square value of deviations of a rectangular 5092 part of a data field. 5093 5094 Grain-wise means that the mean value is determined for each grain (i.e. 5095 cotinguous part of the mask or inverted mask) separately and the deviations 5096 are calculated from these mean values. 5097 5098 @since: 2.29 5099 5100 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5101 @param mode: Masking mode to use. See the introduction for description of 5102 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5103 @param col: Upper-left column coordinate. I{(int)} 5104 @param row: Upper-left row coordinate. I{(int)} 5105 @param width: Area width (number of columns). I{(int)} 5106 @param height: Area height (number of rows). I{(int)} 5107 @return: The root mean square value of deviations from the mean value. I{(float)} 5108 """ 5109 return None
5110
5111 - def area_get_sum(mask, col, row, width, height):
5112 """ 5113 Sums values of a rectangular part of a data field. 5114 5115 This function is equivalent to calling B{C{L{DataField.area_get_sum_mask}}}() 5116 with masking mode B{C{MASK_INCLUDE}}. 5117 5118 5119 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5120 @param col: Upper-left column coordinate. I{(int)} 5121 @param row: Upper-left row coordinate. I{(int)} 5122 @param width: Area width (number of columns). I{(int)} 5123 @param height: Area height (number of rows). I{(int)} 5124 @return: The sum of all values inside area. I{(float)} 5125 """ 5126 return None
5127
5128 - def area_get_sum_mask(mask, mode, col, row, width, height):
5129 """ 5130 Sums values of a rectangular part of a data field. 5131 5132 @since: 2.18 5133 5134 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5135 @param mode: Masking mode to use. See the introduction for description of 5136 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5137 @param col: Upper-left column coordinate. I{(int)} 5138 @param row: Upper-left row coordinate. I{(int)} 5139 @param width: Area width (number of columns). I{(int)} 5140 @param height: Area height (number of rows). I{(int)} 5141 @return: The sum of all values inside area. I{(float)} 5142 """ 5143 return None
5144
5145 - def area_get_median(mask, col, row, width, height):
5146 """ 5147 Computes median value of a data field area. 5148 5149 This function is equivalent to calling 5150 B{C{L{DataField.area_get_median_mask}}}() 5151 with masking mode B{C{MASK_INCLUDE}}. 5152 5153 5154 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 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 median value. I{(float)} 5160 """ 5161 return None
5162
5163 - def area_get_median_mask(mask, mode, col, row, width, height):
5164 """ 5165 Computes median value of a data field area. 5166 5167 @since: 2.18 5168 5169 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5170 @param mode: Masking mode to use. See the introduction for description of 5171 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 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 median value. I{(float)} 5177 """ 5178 return None
5179
5180 - def area_get_surface_area(mask, col, row, width, height):
5181 """ 5182 Computes surface area of a rectangular part of a data field. 5183 5184 This function is equivalent to calling 5185 B{C{L{DataField.area_get_surface_area_mask}}}() with masking mode 5186 B{C{MASK_INCLUDE}}. 5187 5188 5189 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5190 @param col: Upper-left column coordinate. I{(int)} 5191 @param row: Upper-left row coordinate. I{(int)} 5192 @param width: Area width (number of columns). I{(int)} 5193 @param height: Area height (number of rows). I{(int)} 5194 @return: The surface area. I{(float)} 5195 """ 5196 return None
5197
5198 - def area_get_surface_area_mask(mask, mode, col, row, width, height):
5199 """ 5200 Computes surface area of a rectangular part of a data field. 5201 5202 This quantity makes sense only if the lateral dimensions and values of 5203 B{C{data_field}} are the same physical quantities. 5204 5205 @since: 2.18 5206 5207 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5208 @param mode: Masking mode to use. See the introduction for description of 5209 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5210 @param col: Upper-left column coordinate. I{(int)} 5211 @param row: Upper-left row coordinate. I{(int)} 5212 @param width: Area width (number of columns). I{(int)} 5213 @param height: Area height (number of rows). I{(int)} 5214 @return: The surface area. I{(float)} 5215 """ 5216 return None
5217
5218 - def area_get_entropy_at_scales(target_line, mask, mode, col, row, width, height, maxdiv):
5219 """ 5220 Calculates estimates of value distribution entropy at various scales. 5221 5222 @since: 2.44 5223 5224 @param target_line: A data line to store the result to. It will be resampled to 5225 B{C{maxdiv}}+1 items. I{(L{DataLine})} 5226 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5227 @param mode: Masking mode to use. See the introduction for description of 5228 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5229 @param col: Upper-left column coordinate. I{(int)} 5230 @param row: Upper-left row coordinate. I{(int)} 5231 @param width: Area width (number of columns). I{(int)} 5232 @param height: Area height (number of rows). I{(int)} 5233 @param maxdiv: Maximum number of divisions of the value range. Pass zero to 5234 choose it automatically. I{(int)} 5235 @return: The best estimate, as L{DataField.area_get_entropy}(). I{(float)} 5236 """ 5237 return None
5238
5239 - def get_entropy_2d_at_scales(yfield, target_line, maxdiv):
5240 """ 5241 Calculates estimates of entropy of two-dimensional point cloud at various 5242 scales. 5243 5244 @since: 2.44 5245 5246 @param yfield: A data field containing the B{C{y}}-coordinates. I{(L{DataField})} 5247 @param target_line: A data line to store the result to. It will be resampled to 5248 B{C{maxdiv}}+1 items. I{(L{DataLine})} 5249 @param maxdiv: Maximum number of divisions of the value range. Pass zero to 5250 choose it automatically. I{(int)} 5251 @return: The best estimate, as L{DataField.get_entropy_2d}(). I{(float)} 5252 """ 5253 return None
5254
5255 - def area_get_variation(mask, mode, col, row, width, height):
5256 """ 5257 Computes the total variation of a rectangular part of a data field. 5258 5259 The total variation is estimated as the integral of the absolute value of 5260 local gradient. 5261 5262 This quantity has the somewhat odd units of value unit times lateral unit. 5263 It can be envisioned as follows. If the surface has just two height levels 5264 (upper and lower planes) then the quantity is the length of the boundary 5265 between the upper and lower part, multiplied by the step height. If the 5266 surface is piece-wise constant, then the variation is the step height 5267 integrated along the boundaries between the constant parts. Therefore, for 5268 non-fractal surfaces it scales with the linear dimension of the image, not 5269 with its area, despite being an area integral. 5270 5271 @since: 2.38 5272 5273 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5274 @param mode: Masking mode to use. See the introduction for description of 5275 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5276 @param col: Upper-left column coordinate. I{(int)} 5277 @param row: Upper-left row coordinate. I{(int)} 5278 @param width: Area width (number of columns). I{(int)} 5279 @param height: Area height (number of rows). I{(int)} 5280 @return: The variation. I{(float)} 5281 """ 5282 return None
5283
5284 - def area_get_entropy(mask, mode, col, row, width, height):
5285 """ 5286 Estimates the entropy of field data distribution. 5287 5288 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 5289 B{C{n}} is the number of pixels considered, Δ the bin size and B{C{n_i}} the count in 5290 the B{C{i}}-th bin. If B{C{S}} is plotted as a function of the bin size Δ, it is, 5291 generally, a growing function with a plateau for ‘reasonable’ bin sizes. 5292 The estimate is taken at the plateau. If no plateau is found, which means 5293 the distribution is effectively a sum of δ-functions, -B{C{glib.MAXDOUBLE}} is 5294 returned. 5295 5296 It should be noted that this estimate may be biased. 5297 5298 @since: 2.42 5299 5300 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5301 @param mode: Masking mode to use. See the introduction for description of 5302 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5303 @param col: Upper-left column coordinate. I{(int)} 5304 @param row: Upper-left row coordinate. I{(int)} 5305 @param width: Area width (number of columns). I{(int)} 5306 @param height: Area height (number of rows). I{(int)} 5307 @return: The estimated entropy of the data values. The entropy of no data 5308 or a single single is returned as -B{C{glib.MAXDOUBLE}}. I{(float)} 5309 """ 5310 return None
5311
5312 - def area_get_volume(basis, mask, col, row, width, height):
5313 """ 5314 Computes volume of a rectangular part of a data field. 5315 5316 @since: 2.3 5317 5318 @param basis: The basis or background for volume calculation if not B{C{None}}. 5319 The height of each vertex is then the difference between 5320 B{C{data_field}} value and B{C{basis}} value. Value B{C{None}} is the same 5321 as passing all zeroes for the basis. I{(L{DataField})} 5322 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5323 @param col: Upper-left column coordinate. I{(int)} 5324 @param row: Upper-left row coordinate. I{(int)} 5325 @param width: Area width (number of columns). I{(int)} 5326 @param height: Area height (number of rows). I{(int)} 5327 @return: The volume. I{(float)} 5328 """ 5329 return None
5330
5331 - def get_autorange():
5332 """ 5333 Computes value range with outliers cut-off. 5334 5335 The purpose of this function is to find a range is suitable for false color 5336 mapping. The precise method how it is calculated is unspecified and may be 5337 subject to changes. 5338 5339 However, it is guaranteed minimum <= B{C{from}} <= B{C{to}} <= maximum. 5340 5341 This quantity is cached. 5342 5343 @return: Tuple consisting of 2 values (B{C{from_}}, B{C{to}}). (I{(float)}, I{(float)}) 5344 """ 5345 return None, None
5346
5347 - def get_stats():
5348 """ 5349 Computes basic statistical quantities of a data field. 5350 5351 @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)}) 5352 """ 5353 return None, None, None, None, None
5354
5355 - def area_get_stats(mask, col, row, width, height):
5356 """ 5357 Computes basic statistical quantities of a rectangular part of a data field. 5358 5359 This function is equivalent to calling B{C{L{DataField.area_get_stats_mask}}}() 5360 with masking mode B{C{MASK_INCLUDE}}. 5361 5362 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5363 @param col: Upper-left column coordinate. I{(int)} 5364 @param row: Upper-left row coordinate. I{(int)} 5365 @param width: Area width (number of columns). I{(int)} 5366 @param height: Area height (number of rows). I{(int)} 5367 @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)}) 5368 """ 5369 return None, None, None, None, None
5370
5371 - def area_get_stats_mask(mask, mode, col, row, width, height):
5372 """ 5373 Computes basic statistical quantities of a rectangular part of a data field. 5374 5375 @since: 2.18 5376 5377 @param mask: Mask specifying which values to take into account/exclude, or B{C{None}}. I{(L{DataField})} 5378 @param mode: Masking mode to use. See the introduction for description of 5379 masking modes. Expected values: C{B{MASK_EXCLUDE}}, C{B{MASK_INCLUDE}}, C{B{MASK_IGNORE}}. I{(L{MaskingType})} 5380 @param col: Upper-left column coordinate. I{(int)} 5381 @param row: Upper-left row coordinate. I{(int)} 5382 @param width: Area width (number of columns). I{(int)} 5383 @param height: Area height (number of rows). I{(int)} 5384 @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)}) 5385 """ 5386 return None, None, None, None, None
5387
5388 - def area_count_in_range(mask, col, row, width, height, below, above):
5389 """ 5390 Counts data samples in given range. 5391 5392 No assertion is made about the values of B{C{above}} and B{C{below}}, in other words 5393 B{C{above}} may be larger than B{C{below}}. To count samples in an open interval 5394 instead of a closed interval, exchange B{C{below}} and B{C{above}} and then subtract 5395 the B{C{nabove}} and B{C{nbelow}} from B{C{width}}*B{C{height}} to get the complementary counts. 5396 5397 With this trick the common task of counting positive values can be 5398 realized: 5399 <informalexample><programlisting> 5400 L{DataField.area_count_in_range}(data_field, None, 5401 col, row, width, height, 5402 0.0, 0.0, &amp;count, None); 5403 count = width*height - count; 5404 </programlisting></informalexample> 5405 5406 @param mask: Mask specifying which values to take into account, or B{C{None}}. I{(L{DataField})} 5407 @param col: Upper-left column coordinate. I{(int)} 5408 @param row: Upper-left row coordinate. I{(int)} 5409 @param width: Area width (number of columns). I{(int)} 5410 @param height: Area height (number of rows). I{(int)} 5411 @param below: Upper bound to compare data to. The number of samples less 5412 than or equal to B{C{below}} is stored in B{C{nbelow}}. I{(float)} 5413 @param above: Lower bound to compare data to. The number of samples greater 5414 than or equal to B{C{above}} is stored in B{C{nabove}}. I{(float)} 5415 @return: Tuple consisting of 2 values (B{C{nbelow}}, B{C{nabove}}). (I{(int)}, I{(int)}) 5416 """ 5417 return None, None
5418
5419 - def area_dh(mask, target_line, col, row, width, height, nstats):
5420 """ 5421 Calculates distribution of heights in a rectangular part of data field. 5422 5423 @param mask: Mask specifying which values to take into account, or B{C{None}}. I{(L{DataField})} 5424 @param target_line: A data line to store the distribution to. It will be 5425 resampled to requested width. I{(L{DataLine})} 5426 @param col: Upper-left column coordinate. I{(int)} 5427 @param row: Upper-left row coordinate. I{(int)} 5428 @param width: Area width (number of columns). I{(int)} 5429 @param height: Area height (number of rows). I{(int)} 5430 @param nstats: The number of samples to take on the distribution function. If 5431 nonpositive, a suitable resolution is determined automatically. I{(int)} 5432 """ 5433 pass
5434
5435 - def dh(target_line, nstats):
5436 """ 5437 Calculates distribution of heights in a data field. 5438 5439 @param target_line: A data line to store the distribution to. It will be 5440 resampled to requested width. I{(L{DataLine})} 5441 @param nstats: The number of samples to take on the distribution function. If 5442 nonpositive, a suitable resolution is determined automatically. I{(int)} 5443 """ 5444 pass
5445
5446 - def area_cdh(mask, target_line, col, row, width, height, nstats):
5447 """ 5448 Calculates cumulative distribution of heights in a rectangular part of data 5449 field. 5450 5451 @param mask: Mask specifying which values to take into account, or B{C{None}}. I{(L{DataField})} 5452 @param target_line: A data line to store the distribution to. It will be 5453 resampled to requested width. I{(L{DataLine})} 5454 @param col: Upper-left column coordinate. I{(int)} 5455 @param row: Upper-left row coordinate. I{(int)} 5456 @param width: Area width (number of columns). I{(int)} 5457 @param height: Area height (number of rows). I{(int)} 5458 @param nstats: The number of samples to take on the distribution function. If 5459 nonpositive, a suitable resolution is determined automatically. I{(int)} 5460 """ 5461 pass
5462
5463 - def cdh(target_line, nstats):
5464 """ 5465 Calculates cumulative distribution of heights in a data field. 5466 5467 @param target_line: A data line to store the distribution to. It will be 5468 resampled to requested width. I{(L{DataLine})} 5469 @param nstats: The number of samples to take on the distribution function. If 5470 nonpositive, a suitable resolution is determined automatically. I{(int)} 5471 """ 5472 pass
5473
5474 - def area_da(target_line, col, row, width, height, orientation, nstats):
5475 """ 5476 Calculates distribution of slopes in a rectangular part of data field. 5477 5478 @param target_line: A data line to store the distribution to. It will be 5479 resampled to requested width. I{(L{DataLine})} 5480 @param col: Upper-left column coordinate. I{(int)} 5481 @param row: Upper-left row coordinate. I{(int)} 5482 @param width: Area width (number of columns). I{(int)} 5483 @param height: Area height (number of rows). I{(int)} 5484 @param orientation: Orientation to compute the slope distribution in. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 5485 @param nstats: The number of samples to take on the distribution function. If 5486 nonpositive, a suitable resolution is determined automatically. I{(int)} 5487 """ 5488 pass
5489
5490 - def area_da_mask(mask, target_line, col, row, width, height, orientation, nstats):
5491 """ 5492 Calculates distribution of slopes in a rectangular part of data field, with 5493 masking. 5494 5495 @since: 2.49 5496 5497 @param mask: Mask specifying which values to take into account, or B{C{None}}. I{(L{DataField})} 5498 @param target_line: A data line to store the distribution to. It will be 5499 resampled to requested width. I{(L{DataLine})} 5500 @param col: Upper-left column coordinate. I{(int)} 5501 @param row: Upper-left row coordinate. I{(int)} 5502 @param width: Area width (number of columns). I{(int)} 5503 @param height: Area height (number of rows). I{(int)} 5504 @param orientation: Orientation to compute the slope distribution in. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 5505 @param nstats: The number of samples to take on the distribution function. If 5506 nonpositive, a suitable resolution is determined automatically. I{(int)} 5507 """ 5508 pass
5509
5510 - def da(target_line, orientation, nstats):
5511 """ 5512 Calculates distribution of slopes in a data field. 5513 5514 @param target_line: A data line to store the distribution to. It will be 5515 resampled to requested width. I{(L{DataLine})} 5516 @param orientation: Orientation to compute the slope distribution in. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 5517 @param nstats: The number of samples to take on the distribution function. If 5518 nonpositive, a suitable resolution is determined automatically. I{(int)} 5519 """ 5520 pass
5521
5522 - def area_cda(target_line, col, row, width, height, orientation, nstats):
5523 """ 5524 Calculates cumulative distribution of slopes in a rectangular part of data 5525 field. 5526 5527 @param target_line: A data line to store the distribution to. It will be 5528 resampled to requested width. I{(L{DataLine})} 5529 @param col: Upper-left column coordinate. I{(int)} 5530 @param row: Upper-left row coordinate. I{(int)} 5531 @param width: Area width (number of columns). I{(int)} 5532 @param height: Area height (number of rows). I{(int)} 5533 @param orientation: Orientation to compute the slope distribution in. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 5534 @param nstats: The number of samples to take on the distribution function. If 5535 nonpositive, a suitable resolution is determined automatically. I{(int)} 5536 """ 5537 pass
5538
5539 - def area_cda_mask(mask, target_line, col, row, width, height, orientation, nstats):
5540 """ 5541 Calculates cumulative distribution of slopes in a rectangular part of data 5542 field, with masking. 5543 5544 @since: 2.49 5545 5546 @param mask: I{(L{DataField})} 5547 @param target_line: A data line to store the distribution to. It will be 5548 resampled to requested width. I{(L{DataLine})} 5549 @param col: Upper-left column coordinate. I{(int)} 5550 @param row: Upper-left row coordinate. I{(int)} 5551 @param width: Area width (number of columns). I{(int)} 5552 @param height: Area height (number of rows). I{(int)} 5553 @param orientation: Orientation to compute the slope distribution in. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 5554 @param nstats: The number of samples to take on the distribution function. If 5555 nonpositive, a suitable resolution is determined automatically. I{(int)} 5556 """ 5557 pass
5558
5559 - def cda(target_line, orientation, nstats):
5560 """ 5561 Calculates cumulative distribution of slopes in a data field. 5562 5563 @param target_line: A data line to store the distribution to. It will be 5564 resampled to requested width. I{(L{DataLine})} 5565 @param orientation: Orientation to compute the slope distribution in. Expected values: C{B{ORIENTATION_HORIZONTAL}}, C{B{ORIENTATION_VERTICAL}}. I{(L{Orientation})} 5566