{"metadata":{"kernelspec":{"display_name":"R","language":"R","name":"ir"},"language_info":{"codemirror_mode":"r","file_extension":".r","mimetype":"text/x-r-source","name":"R","pygments_lexer":"r","version":"3.3.2"},"_change_revision":0,"_is_fork":false,"kaggle":{"accelerator":"none","dataSources":[{"sourceId":5916,"databundleVersionId":45048,"sourceType":"competition"}],"isInternetEnabled":false,"language":"r","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"Let's try to stitch one of these 16 channel images together","metadata":{"_cell_guid":"fa0d6cb6-b52d-0249-cd63-269ce0790efb"}},{"cell_type":"code","source":"# This R environment comes with all of CRAN preinstalled, as well as many other helpful packages\n# The environment is defined by the kaggle/rstats docker image: https://github.com/kaggle/docker-rstats\n# For example, here's several helpful packages to load in \n\nlibrary(ggplot2) # Data visualization\nlibrary(readr) # CSV file I/O, e.g. the read_csv function\nlibrary(raster) # read and manipulate raster images\n","metadata":{"_cell_guid":"cf3f0d7b-9623-97b1-1e14-4ee4fa3fa0e1"},"outputs":[],"execution_count":null},{"cell_type":"code","source":"## Plot composite 16 channel tiles\n\nfiles16 <- list.files(path=\"../input/sixteen_band/\", pattern=\"6120_\", full.names=T, recursive=FALSE)\ntokeep <- files16[grep(\"_P.tif\", files16)]\ntokeep\n\npar(mfrow = c(5,5))\npar(mar = c(0.1,0.1,0.1,0.1))\nfor(i in tokeep){\n    thisfile <- i\n    img <- stack(thisfile)\n    plot(img, axes = FALSE, legend = FALSE)\n}","metadata":{"_cell_guid":"b2ac1cd4-a52b-5839-fde8-cf2bfe0eedf5"},"outputs":[],"execution_count":null},{"cell_type":"code","source":"## Plot composite RGB tiles\n\nfiles3 <- list.files(path=\"../input/three_band/\", pattern=\"6120_\", full.names=T, recursive=FALSE)\n#tokeep3 <- files3[grep(\"_P.tif\", files3)]\nfiles3\n\npar(mfrow = c(5,5))\npar(mar = c(0.1,0.1,0.1,0.1))\nfor(i in files3[1:2]){\n  thisfile <- i\n  img <- stack(thisfile)\n  plotRGB(img, stretch = \"lin\", axes = FALSE)\n}","metadata":{"_cell_guid":"0102fd40-f094-f2ec-45ea-8b93afc0346a"},"outputs":[],"execution_count":null},{"cell_type":"code","source":"## Close up of image 6120_2_4\n\nimgs <- stack(\"../input/three_band/6120_2_4.tif\")\nplotRGB(imgs, stretch = \"lin\")\nplot(imgs)\n\nimgs16 <- stack(\"../input/sixteen_band/6120_2_4_P.tif\")\nplot(imgs16)","metadata":{"_cell_guid":"55b4e33b-be1a-e2a8-bdcb-817e89526cf1"},"outputs":[],"execution_count":null},{"cell_type":"code","source":"files3 <- list.files(path=\"../input/three_band/\", pattern=\"6120_\", full.names=T, recursive=FALSE)\n#tokeep3 <- files3[grep(\"_P.tif\", files3)]\nfiles3\n\npar(mfrow = c(5,5))\npar(mar = c(0.1,0.1,0.1,0.1))\nfor(i in files3){\n    thisfile <- i\n    img <- stack(thisfile)\n    plotRGB(img, stretch = \"lin\", axes = FALSE)\n}","metadata":{"_cell_guid":"dbf96ef0-60dd-49a5-94a2-361962b26ac3"},"outputs":[],"execution_count":null},{"cell_type":"code","source":"## Close up of image 6120_2_4\n\nimgs <- stack(\"../input/three_band/6120_2_4.tif\")\nplotRGB(imgs, stretch = \"lin\")\nplot(imgs)\n\nimgs16 <- stack(\"../input/sixteen_band/6120_2_4_P.tif\")\nplot(imgs16)","metadata":{"_cell_guid":"53ac433f-66a3-3fe8-baea-822ef87c06f8"},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"_cell_guid":"238c5c5a-d85f-3c73-c21e-62e6dcb13ad9"},"outputs":[],"execution_count":null}]}