Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
imagej-elphel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
imagej-elphel
Commits
be7873b5
Commit
be7873b5
authored
Sep 13, 2024
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
experimenting with different modes
parent
c9ed0a3d
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1737 additions
and
213 deletions
+1737
-213
ShowDoubleFloatArrays.java
.../java/com/elphel/imagej/common/ShowDoubleFloatArrays.java
+95
-0
OrangeTest.java
src/main/java/com/elphel/imagej/orthomosaic/OrangeTest.java
+1642
-213
No files found.
src/main/java/com/elphel/imagej/common/ShowDoubleFloatArrays.java
View file @
be7873b5
...
@@ -91,6 +91,8 @@ import ij.process.ImageProcessor;
...
@@ -91,6 +91,8 @@ import ij.process.ImageProcessor;
return
;
return
;
}
else
showArrays
(
pixels
,
width
,
height
,
title
);
}
else
showArrays
(
pixels
,
width
,
height
,
title
);
}
}
public
static
void
showArrays
(
double
[][]
pixels
,
int
width
,
int
height
,
boolean
asStack
,
String
title
,
String
[]
titles
)
{
public
static
void
showArrays
(
double
[][]
pixels
,
int
width
,
int
height
,
boolean
asStack
,
String
title
,
String
[]
titles
)
{
int
i
,
j
;
int
i
,
j
;
if
(
pixels
==
null
)
{
if
(
pixels
==
null
)
{
...
@@ -118,6 +120,99 @@ import ij.process.ImageProcessor;
...
@@ -118,6 +120,99 @@ import ij.process.ImageProcessor;
return
;
return
;
}
else
showArrays
(
pixels
,
width
,
height
,
titles
);
}
else
showArrays
(
pixels
,
width
,
height
,
titles
);
}
}
public
static
ImagePlus
showArraysHyperstack
(
double
[][]
pixels
,
int
width
,
int
height
,
int
slices
,
String
title
,
String
[]
titles
,
boolean
show
)
{
int
i
,
j
;
if
(
pixels
==
null
)
{
System
.
out
.
println
(
"showDoubleFloatArrays.showArrays(): - pixel array is null"
);
}
float
[]
fpixels
;
ImageStack
array_stack
=
new
ImageStack
(
width
,
height
);
boolean
not_empty
=
false
;
for
(
i
=
0
;
i
<
pixels
.
length
;
i
++)
if
(
pixels
[
i
]!=
null
)
{
not_empty
=
true
;
fpixels
=
new
float
[
pixels
[
i
].
length
];
for
(
j
=
0
;
j
<
fpixels
.
length
;
j
++)
fpixels
[
j
]=(
float
)
pixels
[
i
][
j
];
if
(
i
<
titles
.
length
)
{
array_stack
.
addSlice
(
titles
[
i
],
fpixels
);
}
else
{
array_stack
.
addSlice
(
"slice-"
+
i
,
fpixels
);
}
}
ImagePlus
imp_stack
=
null
;
if
(
not_empty
)
{
imp_stack
=
IJ
.
createImage
(
title
,
// String title,
"32-bit,grayscale-mode"
,
// ,label", // String type,
width
,
// int width,
height
,
// int height,
1
,
// int channels,
slices
,
// int slices,
pixels
.
length
/
slices
);
// frames)
imp_stack
.
setStack
(
array_stack
);
imp_stack
.
getProcessor
().
resetMinAndMax
();
if
(
show
)
{
imp_stack
.
show
();
}
}
return
imp_stack
;
}
public
static
ImagePlus
showArraysHyperstack
(
double
[][][]
pixels
,
int
width
,
String
title
,
String
[]
titles
,
// all slices*frames titles or just slice titles or null
String
[]
frame_titles
,
// frame titles or null
boolean
show
)
{
int
num_frames
=
pixels
.
length
;
int
num_slices
=
pixels
[
0
].
length
;
double
[][]
dpixels
=
new
double
[
num_frames
*
num_slices
][];
// System.out.println("pixels.length="+pixels.length+" pixels[0].length="+pixels[0].length);
for
(
int
f
=
0
;
f
<
num_frames
;
f
++)
{
// System.out.println("f="+f);
for
(
int
s
=
0
;
s
<
num_slices
;
s
++)
{
int
indx
=
s
+
f
*
num_slices
;
// System.out.println("f="+f+" s="+s+" indx="+indx);
dpixels
[
indx
]
=
pixels
[
f
][
s
];
}
}
String
[]
combo_titles
;
if
((
titles
!=
null
)
&&
(
titles
.
length
==
dpixels
.
length
))
{
combo_titles
=
titles
;
}
else
{
combo_titles
=
new
String
[
dpixels
.
length
];
if
(
titles
==
null
)
{
titles
=
new
String
[
pixels
[
0
].
length
];
for
(
int
i
=
0
;
i
<
titles
.
length
;
i
++)
{
titles
[
i
]
=
""
+
i
;
}
}
if
(
frame_titles
==
null
)
{
frame_titles
=
new
String
[
pixels
.
length
];
for
(
int
i
=
0
;
i
<
titles
.
length
;
i
++)
{
frame_titles
[
i
]
=
""
+
i
;
}
}
for
(
int
f
=
0
;
f
<
frame_titles
.
length
;
f
++)
{
for
(
int
s
=
0
;
s
<
titles
.
length
;
s
++)
{
combo_titles
[
s
+
f
*
titles
.
length
]
=
frame_titles
[
f
]+
":"
+
titles
[
s
];
}
}
}
return
showArraysHyperstack
(
dpixels
,
// double[][] pixels,
width
,
// int width,
pixels
[
0
][
0
].
length
/
width
,
// int height,
pixels
[
0
].
length
,
// int slices,
title
,
// String title,
combo_titles
,
// String [] titles);
show
);
// boolean show
}
public
static
void
showComplex
(
double
[][][]
cpixels
,
String
title
)
{
public
static
void
showComplex
(
double
[][][]
cpixels
,
String
title
)
{
int
height
=
cpixels
.
length
;
int
height
=
cpixels
.
length
;
int
width
=
cpixels
[
0
].
length
;
int
width
=
cpixels
[
0
].
length
;
...
...
src/main/java/com/elphel/imagej/orthomosaic/OrangeTest.java
View file @
be7873b5
This diff is collapsed.
Click to expand it.
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