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