{"cells":[{"cell_type":"markdown","metadata":{"_cell_guid":"fa0d6cb6-b52d-0249-cd63-269ce0790efb"},"source":"Let's try to stitch one of these 16 channel images together"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"cf3f0d7b-9623-97b1-1e14-4ee4fa3fa0e1"},"outputs":[],"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"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"b2ac1cd4-a52b-5839-fde8-cf2bfe0eedf5"},"outputs":[],"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}"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"0102fd40-f094-f2ec-45ea-8b93afc0346a"},"outputs":[],"source":"## Plot composite RGB tiles\n\nfiles3 <- list.files(path=\"../input/three_band/\", pattern=\"6120_\", full.names=T, recursive=FALSE)\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}"},{"cell_type":"code","execution_count":null,"metadata":{"_cell_guid":"55b4e33b-be1a-e2a8-bdcb-817e89526cf1"},"outputs":[],"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":{"_change_revision":0,"_is_fork":false,"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"}},"nbformat":4,"nbformat_minor":0}