Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Zellige-core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IdA Public
Zellige-core
Merge requests
!11
Draft: Plugin classes
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Draft: Plugin classes
dev-plugin
into
dev
Overview
0
Commits
5
Pipelines
2
Changes
14
Closed
Céline TREBEAU
requested to merge
dev-plugin
into
dev
4 years ago
Overview
0
Commits
5
Pipelines
2
Changes
14
Expand
Classes for the ImageJ plugin.
Edited
4 years ago
by
Céline TREBEAU
0
0
Merge request reports
Compare
dev
version 1
9f10912a
4 years ago
dev (base)
and
latest version
latest version
1d812203
5 commits,
4 years ago
version 1
9f10912a
3 commits,
4 years ago
14 files
+
1625
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
14
Search (e.g. *.vue) (Ctrl+P)
src/main/java/StartingOSStats.java
0 → 100644
+
108
−
0
Options
import
ij.ImageJ
;
import
io.scif.img.IO
;
import
io.scif.img.SCIFIOImgPlus
;
import
net.imglib2.img.Img
;
import
net.imglib2.type.NativeType
;
import
net.imglib2.type.numeric.RealType
;
import
java.io.BufferedWriter
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.util.TreeMap
;
public
class
StartingOSStats
{
BufferedWriter
writer
;
FileWriter
fileWriter
;
private
final
String
path
=
"C:\\Users\\ctrebeau\\Desktop\\stats\\"
;
public
StartingOSStats
(
String
fileName
)
throws
IOException
{
fileName
.
replace
(
"tif"
,
"txt"
);
writer
=
new
BufferedWriter
(
new
FileWriter
(
fileName
));
writer
.
write
(
path
+
fileName
);
}
public
void
writeParameter
(
String
amplitude
,
String
otsu
,
String
sigmas
,
String
delta
)
throws
IOException
{
StringBuilder
s
=
new
StringBuilder
(
"Amplitude percent : "
+
amplitude
+
"Otsu percent : "
+
otsu
+
System
.
lineSeparator
()
+
"Sigmas : "
+
sigmas
+
System
.
lineSeparator
()+
"Delta : "
+
delta
+
System
.
lineSeparator
());
writer
.
write
(
s
.
toString
()
);
}
public
void
close
()
throws
IOException
{
writer
.
close
();
}
public
void
writeHistogram
(
TreeMap
<
Integer
,
Integer
>
map
)
throws
IOException
{
writer
.
write
(
map
.
toString
());
}
public
void
writeInfo
(
String
info
,
double
value
)
throws
IOException
{
writer
.
write
(
info
+
" : "
+
value
);
}
public
static
<
T
extends
RealType
<
T
>
&
NativeType
<
T
>
>
void
main
(
String
[]
args
)
throws
IOException
{
String
path
=
"C:\\Users\\ctrebeau\\Desktop\\MoucheAile\\STK\\"
;
String
fileName
=
"STK_Mouche_c01_f0001_p005.tif"
;
// Input of the image.
final
String
imagePath
=
path
+
fileName
;
// "doc/BG2.tif";
System
.
out
.
println
(
"File : "
+
fileName
);
ImageJ
ij
=
new
ImageJ
();
/* JY version for opening files. */
final
SCIFIOImgPlus
<
?
>
imgPlus
=
IO
.
openImgs
(
imagePath
).
get
(
0
);
final
Img
<
T
>
stackImage
=
(
Img
<
T
>
)
imgPlus
.
getImg
();
/* User Parameters AKA arguments to run the program*/
double
amplitude
=
Double
.
parseDouble
(
args
[
0
]
);
double
otsu
=
Double
.
parseDouble
(
args
[
1
]
);
int
sigmas
=
Integer
.
parseInt
(
args
[
2
]
);
int
k1
=
Integer
.
parseInt
(
args
[
3
]
);
double
percent1
=
Double
.
parseDouble
(
args
[
4
]
);
int
k2
=
Integer
.
parseInt
(
args
[
5
]
);
double
percent2
=
Double
.
parseDouble
(
args
[
6
]
);
int
delta
=
Integer
.
parseInt
(
args
[
7
]
);
/* End of parameters. */
// UserParameters userParameters = new UserParameters( amplitude, otsu, sigmas, delta, "MIP", 0 );
// AdvancedUserParameters advancedUserParameters = new AdvancedUserParameters( k1, percent1, k2, percent2 );
//
// IJ.log("Type: "+ imgPlus.firstElement().getClass().toGenericString());
//
// if ( stackImage.numDimensions() == 3 )// Is it a stack ?
// {
//// ImageJFunctions.show( stackImage, "original" );
//// ImageJFunctions.show( TestMIP.findMIP( stackImage, stackImage.factory() ), "MIP" );
// new ReferenceSurfaceExtraction<>( stackImage, stackImage.factory(),userParameters, advancedUserParameters );
// }
// else
// {
// System.out.println( " This image has to be a z-stack ! " );
// }
// StartingOSStats startingOSStats = new StartingOSStats( fileName );
// startingOSStats.writeParameter( args[ 0 ] , args[ 1 ] , args[ 2 ], args[ 3 ] );
// startingOSStats.writeInfo( "OS count ", OSE.getCount() );
//// startingOSStats.writeHistogram( OSE.getOcc() );
// startingOSStats.close();
}
}
Loading