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

Source Code for Module gwy

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