integ.profile: Simple Integration for Making Profile

Description Usage Arguments Details Value See Also Examples

Description

A function returns integrated line profile. It crops rectangular area from a requested size and project and integrate pixel values either to horizontal or vertical axis. When used with a matrix in polar coordinate (car2pol) calculated from power spectrum (power.spec) of an image, the function provides radial integration or azimuthal integration that are useful for diffraction analysis.

Usage

1
integ.profile(x, axis="H", h=c(20, 50), v=c(30, 120), disp=FALSE)

Arguments

x

A raster image or a matrix

axis

Axis to project. H : Projection to horizontal axis or radial distance ( in polar coordinate). V : Projection to vertical axis or azimuthal angle ( in polar coordinate).

h

c(h1,h2) : A horizontal or radial (in polar coordinate) range for integration.

v

c(v1,v2) : A vertical or azimuthal (in polar coordinate) range for integration.

disp

Plot calculated profile. Default is FALSE.

Details

The row and column corresponds to horizontal and vertical axes, respectively.

Value

An array of requested line profile

See Also

swap.quad, car2pol, fft, Mod

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data("camphora")
img <- camphora
par(mfrow=c(2,2))
image(rot90c(img),col=gray(c(0:255)/255), useRaster=TRUE, main="camphora",asp=1, axes=FALSE)
integ.profile(img, axis="H", h=c(1,nrow(img)) , v=c(1,ncol(img)), disp=TRUE)
integ.profile(img, axis="V", h=c(1,nrow(img)) , v=c(1,ncol(img)), disp=TRUE)
ps <- log(swap.quad(Mod(fft(img))))
pol <- car2pol(ps)
image(rot90c(ps),col=gray(c(0:255)/255), useRaster=TRUE,main="power spectrum",asp=1, axes=FALSE)
image(rot90c(pol),col=gray(c(0:255)/255), useRaster=TRUE,main="polar map",asp=1)
integ.profile(pol, axis="H", h=c(10,200) , v=c(0,90), disp=TRUE)
integ.profile(pol, axis="V", h=c(70,100) , v=c(0,360), disp=TRUE)

Example output

  [1] 359.7843 348.0157 346.3451 345.5216 351.0627 349.8000 343.3922 339.7843
  [9] 333.4588 340.8314 342.0392 344.1373 341.2745 327.1529 320.5608 325.5686
 [17] 331.9529 340.3725 346.6706 344.2549 332.0706 324.5882 337.1020 344.1882
 [25] 339.2431 333.5412 339.6314 338.3451 325.2314 325.1020 339.2314 336.2471
 [33] 318.6314 323.8314 337.3843 330.5647 332.8510 331.3098 316.0353 304.6824
 [41] 302.7451 312.9216 327.8314 328.9529 313.0941 308.9961 314.2000 311.7255
 [49] 307.6941 317.4902 318.4235 323.6353 322.5137 309.2118 296.6784 306.0078
 [57] 313.4941 328.6588 333.0392 314.6824 306.9294 308.3961 309.4510 313.7333
 [65] 323.2510 324.9373 316.8196 311.3647 315.4196 311.6588 304.2863 300.1843
 [73] 313.8118 326.7608 326.3255 317.6784 305.9843 304.4078 312.0078 315.2353
 [81] 323.3176 326.4784 326.2784 327.4314 337.1176 353.8078 354.1216 345.9490
 [89] 340.2745 339.3843 352.6510 354.1608 356.1529 355.6235 349.1725 356.1216
 [97] 364.3216 363.7725 366.4627 354.4118 344.9176 348.8627 367.8980 373.6196
[105] 370.7412 369.9529 365.6980 363.8941 374.4941 385.4549 389.4980 389.2235
[113] 387.5216 395.9490 389.2980 385.5647 385.1412 385.2745 393.4000 397.8471
[121] 398.5647 389.4431 376.6706 380.7765 387.8863 387.3882 380.4314 376.9255
[129] 377.4196 372.9059 377.7647 390.4980 392.4235 390.7725 380.4706 369.3765
[137] 379.9020 382.3569 380.2078 380.0667 381.1529 379.6196 378.1137 377.0706
[145] 375.0745 377.8549 379.8510 379.4980 367.9490 359.1804 361.9098 364.6941
[153] 362.4078 363.4510 367.6078 360.6000 358.5490 362.0235 368.5922 363.8157
[161] 354.2745 345.0157 353.7333 360.0588 353.8275 340.1608 328.0863 332.8275
[169] 340.4039 345.9529 332.1294 323.7098 330.9765 332.7882 327.7647 320.0353
[177] 311.0157 303.1529 314.6784 321.2471 322.7373 332.8824 329.2431 323.2157
[185] 319.9843 322.4275 337.1412 340.3765 329.8667 317.7333 321.1490 327.1765
[193] 326.1333 330.7882 325.4941 310.7216 308.7922 317.3373 328.3255 334.7098
[201] 336.3686 337.4549 333.4157 327.1608 323.4863 325.7686 340.8863 344.7294
[209] 341.2157 341.4314 344.1176 348.0196 351.5059 343.7098 333.3451 333.0392
[217] 341.7490 346.9137 340.1490 342.4902 339.0275 331.8157 327.0471 337.2588
[225] 338.7804 335.5843 334.3882 333.6314 330.2706 327.9176 341.8941 346.7608
[233] 340.4863 336.2471 339.0706 341.9490 341.6667 340.1020 342.0824 351.0275
[241] 351.5686 341.8235 339.5843 346.8510 347.4078 341.8627 335.4667 322.1569
[249] 322.8353 320.7608 317.8275 326.3176 328.1059 339.5451 347.7725 340.1882
[257] 346.9804 354.8863 352.1922 349.9176 341.8941 348.4353 355.2392 349.6157
[265] 347.4941 344.3765 333.7373 334.4471 342.5216 349.4980 348.7804 354.3255
[273] 360.0078 355.3647 361.1569 366.1922 358.1490 360.1686 360.6353 364.1490
[281] 364.7804 365.0510 367.8392 367.3608 368.0118 361.7529 354.8863 354.2588
[289] 359.4196 369.7451 378.0118 377.5569 372.6745 372.6078 377.5137 375.9725
[297] 372.2196 376.3961 381.2000 382.8314 381.0824 376.9373 370.8588 370.7294
[305] 381.0000 376.7137 369.8902 371.1608 374.3882 373.3098 369.3529 368.0627
[313] 371.3529 369.0078 367.2549 368.1412 367.2824 358.5137 361.8627 370.7216
[321] 365.4980 367.0353 371.3608 371.6000 368.3137 365.4235 361.8392 354.1412
[329] 347.0235 347.0902 347.4314 349.5176 357.7255 359.4549 360.6706 365.4039
[337] 358.0275 352.6392 349.9098 357.2471 366.5961 366.8941 365.5137 359.8941
[345] 365.7098 369.7176 366.5647 360.6118 355.1686 348.8471 340.3333 345.9176
[353] 348.8667 343.4078 339.4510 320.4078 285.3569 265.9412 261.7569 243.9686
[361] 221.4745 211.3294 214.1020 211.3098 202.5333 192.0392 191.9451 198.0471
[369] 208.0039 219.0549 222.9137 223.7922 228.1294 231.4627 238.8902 243.7686
[377] 243.0196 242.1333 242.5216 243.6275 245.1020 244.8392 244.0353 248.9451
[385] 246.6196 244.1882 242.5569 240.2196 243.1647 243.6667 238.4471 244.0431
[393] 254.4863 259.8510 262.0824 265.7529 269.5725 260.2353 250.1765 263.3608
[401] 276.0863 271.6471 258.7294 253.0863 258.5373 267.3333 274.8118 278.7922
[409] 282.8902 283.5922 284.3765 283.9333 284.0275 289.9176 293.0196 292.7804
[417] 293.0667 282.1647 278.1412 287.1804 294.4118 293.6627 283.3882 279.2314
[425] 282.2471 288.3882 297.0824 299.0471 295.3608 288.9059 294.0314 300.1882
[433] 294.9294 292.4157 292.4000 298.4902 294.3922 289.0353 285.0588 286.5137
[441] 293.3176 296.1608 294.5373 297.1059 298.0745 297.5922 297.9608 298.8157
[449] 295.2118 291.2157 301.1059 305.0353 301.4863 301.2471 300.6471 306.2235
[457] 309.7098 305.3412 300.5843 306.4196 309.5137 309.2157 314.9647 321.3294
[465] 324.6745 319.7059 306.9647 306.1490 308.2824 315.1020 321.8667 324.8118
[473] 321.3608 309.7059 304.5529 310.8980 319.3333 324.9059 329.0784 334.1059
[481] 337.3804 336.5255 331.2510 325.8078 325.6667 330.2627
  [1] 286.5686 293.2941 261.1020 244.5451 259.5412 272.7216 286.5843 306.5765
  [9] 303.1098 274.7843 261.6510 281.9020 298.9490 308.3843 312.1255 309.1333
 [17] 312.0314 301.3843 269.9255 263.5961 273.6275 265.5608 247.8235 210.8706
 [25] 216.8353 259.2392 261.1137 268.8275 301.8549 304.7765 267.9255 242.8980
 [33] 268.3765 279.7176 271.3686 266.4784 256.0824 249.5059 241.6314 232.5961
 [41] 242.3725 267.6353 277.6078 275.7412 283.8549 292.2118 296.3020 298.0235
 [49] 307.8078 319.2980 295.6078 266.2471 254.0000 263.2471 277.2510 281.2627
 [57] 295.8588 313.0431 303.2902 275.7922 255.5176 266.4431 271.7961 274.2431
 [65] 278.5333 294.1608 305.1412 308.2275 310.6000 326.7373 333.5922 325.8078
 [73] 328.7882 336.3255 330.8588 314.3529 313.6196 323.7961 329.2196 338.8706
 [81] 355.7294 357.3020 352.7137 344.8627 332.7882 327.6353 341.6000 354.0196
 [89] 361.8902 369.8941 376.1804 370.3490 354.9373 351.9412 359.0667 356.0745
 [97] 344.4902 344.1373 357.5804 372.6627 376.6275 368.7804 366.4510 366.6196
[105] 363.6980 363.5843 361.1412 349.9843 343.6784 344.6157 343.1451 338.2196
[113] 335.2392 330.6706 334.9059 343.1765 336.5490 318.6353 314.3765 308.9765
[121] 300.6275 310.4784 328.1490 342.0118 345.6196 343.2941 337.9216 335.8510
[129] 344.8157 335.1647 314.0471 305.4235 310.6549 317.0039 311.2745 309.5294
[137] 318.0235 314.9059 302.1725 286.1961 274.4980 273.9647 278.3529 291.0314
[145] 292.1020 294.0235 310.5843 304.5255 300.2314 314.6275 316.6471 305.2941
[153] 291.9294 279.3490 278.0941 287.3373 285.1137 291.3059 286.8980 288.2627
[161] 319.7294 339.2745 331.5765 310.2235 294.3529 285.6000 284.7686 304.1529
[169] 329.4078 340.9882 324.0078 316.2039 317.5451 310.7961 300.2941 286.2667
[177] 278.4902 280.9294 286.1608 305.9412 312.5373 317.6980 323.0510 336.1882
[185] 352.4588 359.2157 357.0196 349.4275 334.9216 332.5294 345.9765 352.8706
[193] 353.0353 348.8157 341.4902 335.5255 330.6157 335.7216 346.0627 350.6667
[201] 348.2745 357.9608 363.9922 365.0745 359.8588 355.4784 352.2196 347.3804
[209] 347.8471 354.4980 364.4196 361.5882 356.1529 345.9020 333.1333 330.0902
[217] 334.6314 334.0784 332.8392 338.1098 344.3255 335.7255 310.8706 289.1490
[225] 291.5098 299.7412 312.9098 320.2941 300.9216 291.1608 327.2353 351.4627
[233] 347.4392 308.7882 276.0353 290.0980 290.0039 299.4078 292.1059 281.1176
[241] 293.7373 307.4510 315.0078 301.5216 269.4549 262.7373 281.6941 287.0745
[249] 291.1961 295.4824 295.6471 294.4588 317.6000 355.7686 369.8941 347.3804
[257] 312.2196 308.9373 330.2627 341.7255 340.2980 342.2196 343.6902 338.2039
[265] 322.7451 309.2784 321.6549 340.4157 334.8157 313.3451 311.8588 321.7647
[273] 325.1137 310.2902 296.5137 287.6314 286.3137 295.2745 298.1216 302.8824
[281] 306.9765 291.6431 259.3608 248.2706 260.8941 270.1412 265.5608 255.2902
[289] 254.1569 262.5647 274.0863 275.5451 257.5804 242.6863 248.2510 267.4118
[297] 278.7059 273.6588 262.2706 265.7882 263.7451 279.1059 299.8510 265.7176
[305] 240.4980 276.2902 255.3529 217.8078 226.3569 262.4902 277.5647 275.8314
[313] 278.4745 299.8392 311.7098 320.9451 340.0471 343.2510 326.8902 302.0627
[321] 297.8745 323.4431 331.6784 332.6392 335.4471 317.2863 310.1098 310.0353
[329] 299.1765 287.3922 298.9647 313.7216 321.1294 317.7647 289.0235 262.1255
[337] 257.4314 263.2980 268.8549 256.7804 234.5882 219.2196 228.1961 245.2314
[345] 242.8157 244.2941 269.0196 287.6941 308.2902 310.1569 301.6039 284.6824
[353] 274.6549 284.8863 306.3373 320.1765 317.4549 308.6510 309.0706 319.9647
[361] 311.6706 311.1294 327.8588 340.3373 338.4510 327.7843 315.2941 320.5765
[369] 324.7137 321.7804 320.8588 323.3373 340.2157 374.6275 388.7451 380.5176
[377] 347.9569 322.6784 325.2706 339.0745 341.2510 324.0706 317.0510 332.0275
[385] 357.0706 356.6039 350.6941 351.5216 327.0980 294.3490 297.2000 320.7373
[393] 335.8392 315.2902 278.8902 294.0000 327.1882 350.0667 360.2863 347.1490
[401] 318.1804 295.0039 285.3216 274.7059 281.9176 303.1961 314.2510 308.9765
[409] 274.4275 263.3961 292.7412 313.8000 324.9020 318.7490 282.2902 241.6980
[417] 246.5255 268.8902 275.5608 251.5373 238.6784 269.4824 302.1255 319.0667
[425] 334.5529 328.8863 301.1765 284.8275 290.2471 297.0353 282.9922 296.2000
[433] 333.6353 354.2157 353.4196 337.1647 297.1765 281.5255 288.6000 310.3176
[441] 324.5569 331.3176 342.5647 332.7882 313.2510 301.7882 295.2980 297.7020
[449] 300.9255 313.7490 319.9255 318.4353 320.4745 330.7765 318.3804 290.4745
[457] 283.4000 297.1843 318.2510 326.1059 326.9529 333.4471 321.8235 302.4627
[465] 297.4157 310.5804 324.2824 327.8353 321.4627 308.9961 310.6314 331.4353
[473] 346.5961 342.9451 333.5961 332.3451 334.4784 339.5647 338.0824 332.2196
[481] 330.6275 325.3608 315.6314 314.5882 320.5098 317.3412 315.3373 326.9686
[489] 341.2275 345.4118 333.1333 312.2471 301.3804 308.3059 313.3765 305.7020
[497] 304.9137 314.1451 312.1373 310.3882 322.5020 338.5333 336.2431 317.5020
[505] 297.7765 278.8510 265.0078 268.9216 289.7843 308.6784 315.5843 310.5608
[513] 315.1882 324.3176 317.7569 284.4941 273.4118 297.9059
  [1] 581 599 582 576 548 563 571 527 528 525 540 528 525 518 502 494 502 514
 [19] 488 490 500 492 487 483 485 478 470 481 467 482 467 475 469 468 482 473
 [37] 466 461 466 467 464 463 470 467 461 456 464 463 459 464 468 456 463 454
 [55] 452 451 458 461 456 461 453 452 461 456 460 468 463 464 462 464 467 460
 [73] 457 460 461 463 457 456 459 460 452 452 453 455 461 436 450 452 445 445
 [91] 446 450 448 448 443 442 445 443 436 429 433 434 432 434 435 429 431 431
[109] 423 426 414 426 424 417 420 418 416 424 403 410 417 415 411 413 401 407
[127] 412 396 404 403 399 393 399 399 397 403 380 380 384 393 391 386 383 384
[145] 377 376 372 379 376 365 363 368 367 376 362 359 365 356 357 350 362 357
[163] 352 350 353 360 352 348 348 343 348 348 354 349 343 333 327 332 322 336
[181] 333 325 341 328 324 325 329 317 319 324 322
  [1] 158 156 165 160 164 161 162 162 155 152 159 162 162 163 158 162 165 160
 [19] 162 163 154 158 155 159 159 162 155 152 153 156 158 159 155 154 157 154
 [37] 158 156 159 151 148 150 155 145 149 151 149 152 152 151 148 148 154 146
 [55] 144 145 153 145 143 154 151 154 149 152 155 153 144 146 155 150 150 151
 [73] 151 153 152 150 153 161 162 161 172 161 170 168 171 184 182 192 191 189
 [91] 180 177 175 170 169 158 159 156 157 163 151 156 153 154 152 151 149 151
[109] 150 143 152 152 145 152 149 149 150 150 149 143 142 144 142 149 147 147
[127] 144 142 149 148 149 148 151 146 150 149 151 148 150 152 151 155 153 152
[145] 147 153 156 151 161 155 155 151 160 158 150 152 156 155 156 157 156 159
[163] 156 154 157 159 155 159 161 156 156 152 153 155 154 162 153 161 159 161
[181] 153 165 157 161 157 162 159 155 155 160 162 165 165 164 160 162 159 167
[199] 158 153 157 155 156 156 161 153 161 157 156 156 156 155 152 158 155 152
[217] 158 154 154 149 152 149 154 145 156 151 152 156 151 150 150 153 154 146
[235] 149 147 150 149 146 145 147 151 154 143 150 151 152 151 146 153 151 151
[253] 152 153 152 150 153 156 158 162 162 169 160 166 165 174 175 185 187 189
[271] 186 185 177 178 171 162 165 157 160 158 158 153 153 151 156 152 148 148
[289] 149 146 151 143 151 148 148 147 149 149 153 152 149 145 139 145 143 150
[307] 147 147 144 145 146 151 151 147 154 145 149 151 148 148 143 156 149 153
[325] 152 150 148 155 156 152 154 155 154 150 159 154 153 155 156 155 157 160
[343] 157 152 160 160 158 155 158 155 155 154 157 154 159 154 156 162 160 159

wvtool documentation built on May 1, 2019, 10:27 p.m.

Related to integ.profile in wvtool...