I have to read some tif files and modify them by rotating, cutting or inversing them. I figured out how to import my file and I can modify it by translating the data into a matrix but now I don't know how to make a tif file with the information I stored into this matrix.
I searched for a while but it seems that nobody asked this so, could someone give me some ideas to complete this task pls?
Here is my code.
rotation = function(Matrice){
res = matrix(c(rep(NA, length(Matrice))), nrow = ncol(Matrice), ncol = nrow(Matrice))
for (i in 1:nrow(Matrice)){
res[,(nrow(Matrice) - i + 1)] = Matrice[i,]
}
return(res)
}
photo = readTIFF("../DataSqueletted/1.tif")
photo2 = matrix(photo, ncol = 1280, nrow = 960)
photo2 = rotation(photo2)
"photo" is a large array while "photo2" is a matrix butwhen i type "View(photo)" i've got the exact same structure.