Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Feret Jean-Baptiste
biodivMapR
Commits
cd8f86c3
Commit
cd8f86c3
authored
Sep 03, 2019
by
jbferet
Browse files
- read_image_subset: changed Image.Chunk into Image_Chunk
parent
3ccebd9a
Changes
1
Show whitespace changes
Inline
Side-by-side
R/Lib_ImageProcess.R
View file @
cd8f86c3
...
...
@@ -702,25 +702,25 @@ read_image_subset <- function(ImPath, HDR, Byte.Start, lenBin, nbLines, Image_Fo
}
if
(
Image_Format
$
Type
==
"INT"
)
{
if
(
HDR
$
`data type`
==
1
)
{
Image
.
Chunk
<-
readBin
(
fidIm
,
integer
(),
n
=
lenBin
,
size
=
Image_Format
$
Bytes
,
signed
=
FALSE
,
endian
=
Image_Format
$
ByteOrder
)
Image
_
Chunk
<-
readBin
(
fidIm
,
integer
(),
n
=
lenBin
,
size
=
Image_Format
$
Bytes
,
signed
=
FALSE
,
endian
=
Image_Format
$
ByteOrder
)
}
else
{
Image
.
Chunk
<-
readBin
(
fidIm
,
integer
(),
n
=
lenBin
,
size
=
Image_Format
$
Bytes
,
signed
=
TRUE
,
endian
=
Image_Format
$
ByteOrder
)
Image
_
Chunk
<-
readBin
(
fidIm
,
integer
(),
n
=
lenBin
,
size
=
Image_Format
$
Bytes
,
signed
=
TRUE
,
endian
=
Image_Format
$
ByteOrder
)
}
}
else
if
(
Image_Format
$
Type
==
"FLOAT"
)
{
Image
.
Chunk
<-
readBin
(
fidIm
,
numeric
(),
n
=
lenBin
,
size
=
Image_Format
$
Bytes
,
endian
=
Image_Format
$
ByteOrder
)
Image
_
Chunk
<-
readBin
(
fidIm
,
numeric
(),
n
=
lenBin
,
size
=
Image_Format
$
Bytes
,
endian
=
Image_Format
$
ByteOrder
)
}
if
(
ImgFormat
==
"3D"
|
ImgFormat
==
"2D"
)
{
Image
.
Chunk
<-
aperm
(
array
(
Image
.
Chunk
,
dim
=
c
(
HDR
$
samples
,
HDR
$
bands
,
nbLines
)),
c
(
3
,
1
,
2
))
Image
_
Chunk
<-
aperm
(
array
(
Image
_
Chunk
,
dim
=
c
(
HDR
$
samples
,
HDR
$
bands
,
nbLines
)),
c
(
3
,
1
,
2
))
}
if
(
ImgFormat
==
"2D"
)
{
Image
.
Chunk
<-
array
(
Image
.
Chunk
,
c
(
nbLines
*
HDR
$
samples
,
HDR
$
bands
))
Image
_
Chunk
<-
array
(
Image
_
Chunk
,
c
(
nbLines
*
HDR
$
samples
,
HDR
$
bands
))
}
if
(
ImgFormat
==
"Shade"
)
{
Image
.
Chunk
<-
matrix
(
Image
.
Chunk
,
nbLines
,
HDR
$
samples
,
byrow
=
T
)
Image
_
Chunk
<-
matrix
(
Image
_
Chunk
,
nbLines
,
HDR
$
samples
,
byrow
=
T
)
}
close
(
fidIm
)
return
(
Image
.
Chunk
)
return
(
Image
_
Chunk
)
}
#' ENVI functions
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment