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
Commits
b5ca8eea
Commit
b5ca8eea
authored
3 months ago
by
Céline TREBEAU
Browse files
Options
Downloads
Patches
Plain Diff
Refactor : addition of Construction class
parent
48baae18
No related branches found
No related tags found
2 merge requests
!47
Feature : Multi-channel and Binning
,
!41
Resolve "Consider rescaling (binning) large images"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/fr/pasteur/ida/zellige/steps/construction/Construction.java
+92
-0
92 additions, 0 deletions
.../pasteur/ida/zellige/steps/construction/Construction.java
with
92 additions
and
0 deletions
src/main/java/fr/pasteur/ida/zellige/steps/construction/Construction.java
0 → 100644
+
92
−
0
View file @
b5ca8eea
package
fr.pasteur.ida.zellige.steps.construction
;
import
fr.pasteur.ida.zellige.ReferenceSurfaceExtraction
;
import
fr.pasteur.ida.zellige.element.ReferenceSurface
;
import
fr.pasteur.ida.zellige.element.Surface
;
import
fr.pasteur.ida.zellige.steps.construction.exception.NoSurfaceFoundException
;
import
fr.pasteur.ida.zellige.steps.construction.rounds.ConstructionParameters
;
import
fr.pasteur.ida.zellige.steps.construction.rounds.FirstRoundConstruction
;
import
fr.pasteur.ida.zellige.steps.construction.rounds.SecondRoundConstruction
;
import
net.imglib2.RandomAccessibleInterval
;
import
net.imglib2.img.Img
;
import
net.imglib2.img.ImgFactory
;
import
net.imglib2.type.NativeType
;
import
net.imglib2.type.numeric.RealType
;
import
net.imglib2.type.numeric.real.FloatType
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.ArrayList
;
public
class
Construction
<
T
extends
RealType
<
T
>
&
NativeType
<
T
>
>
{
private
final
static
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
Construction
.
class
);
private
final
ArrayList
<
ReferenceSurface
<
T
>
>
referenceSurfaces
=
new
ArrayList
<>();
private
int
FS_startingOS_count
;
private
int
FS_OS_count
;
private
int
FS_smallSurfaces
;
private
int
FS_goodSurfaces
;
private
int
FS_finalizedSurfaces
;
private
int
SS_startingOS_count
;
private
int
SS_OS_count
;
private
int
SS_smallSurfaces
;
private
int
SS_goodSurfaces
;
private
long
FS_OSConstructionProcessingTime
;
private
long
FS_SurfaceConstructionProcessingTime
;
private
long
SS_OSConstructionProcessingTime
;
private
long
SS_SurfaceConstructionProcessingTime
;
public
static
<
T
extends
RealType
<
T
>
&
NativeType
<
T
>
>
ArrayList
<
ReferenceSurface
<
T
>
>
run
(
ConstructionParameters
[]
constructionParameters
,
RandomAccessibleInterval
<
T
>
input
,
ImgFactory
<
T
>
factory
,
Img
<
FloatType
>
selectedPixels
,
int
bin
)
throws
NoSurfaceFoundException
{
Construction
<
T
>
construction
=
new
Construction
<>();
construction
.
run
(
constructionParameters
,
selectedPixels
,
input
,
factory
,
bin
);
return
construction
.
referenceSurfaces
;
}
private
void
run
(
ConstructionParameters
[]
constructionParameters
,
Img
<
FloatType
>
selectedPixels
,
RandomAccessibleInterval
<
T
>
input
,
ImgFactory
<
T
>
factory
,
int
bin
)
throws
NoSurfaceFoundException
{
LOGGER
.
debug
(
"Running construction..."
);
/* First round construction*/
FirstRoundConstruction
step1
=
new
FirstRoundConstruction
(
selectedPixels
,
constructionParameters
[
0
]
);
step1
.
process
();
ArrayList
<
Surface
>
tempSurfaces
=
step1
.
getSurfaces
();
FS_startingOS_count
=
step1
.
getStartingOSCount
();
FS_OS_count
=
step1
.
getOSCount
();
FS_goodSurfaces
=
step1
.
getGoodSurfacesCount
();
FS_smallSurfaces
=
step1
.
getSmallSurfacesCount
();
FS_finalizedSurfaces
=
tempSurfaces
.
size
();
FS_OSConstructionProcessingTime
=
step1
.
getOSConstructionProcessingTime
();
FS_SurfaceConstructionProcessingTime
=
step1
.
getConstructionProcessingTime
();
LOGGER
.
debug
(
"first round surfaces = {}"
,
tempSurfaces
.
size
()
);
/* Second round construction */
SecondRoundConstruction
step2
=
new
SecondRoundConstruction
(
tempSurfaces
,
constructionParameters
[
1
]
);
step2
.
process
();
ArrayList
<
Surface
>
finalSurfaces
=
step2
.
getSurfaces
();
SS_startingOS_count
=
step2
.
getStartingOSCount
();
SS_OS_count
=
step2
.
getOSCount
();
SS_goodSurfaces
=
step2
.
getGoodSurfacesCount
();
SS_smallSurfaces
=
step2
.
getSmallSurfacesCount
();
SS_OSConstructionProcessingTime
=
step2
.
getOSConstructionProcessingTime
();
SS_SurfaceConstructionProcessingTime
=
step2
.
getConstructionProcessingTime
();
/* Building reference surfaces */
referenceSurfaces
.
addAll
(
ConstructionCompletion
.
run
(
input
,
factory
,
finalSurfaces
,
bin
)
);
LOGGER
.
debug
(
" Constructions of {} surfaces."
,
referenceSurfaces
.
size
()
);
}
public
ArrayList
<
ReferenceSurface
<
T
>
>
getReferenceSurfaces
()
{
return
referenceSurfaces
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment