Skip to content

Commit

Permalink
Update Operetta command with new API
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoKiaru committed Dec 10, 2024
1 parent ba96ab1 commit 76c2192
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void run() {
final IFormatReader[] reader = new IFormatReader[1];
Thread t = new Thread(() -> {
try {
reader[0] = OperettaManager.createReader(f.getAbsolutePath());
reader[0] = OperettaManager.Builder.createReader(f.getAbsolutePath());
} catch (IOException e) {
e.printStackTrace();
} catch (FormatException e) {
Expand Down Expand Up @@ -179,12 +179,6 @@ public void run() {
int stack_width = reader[0].getSizeX();
int stack_height = reader[0].getSizeY();

opm.getAvailableWellsString().forEach(System.out::println);
opm.getAvailableWells().forEach(System.out::println);
opm.getAvailableFieldIds().forEach(System.out::println);
opm.getAvailableFieldsString().forEach(System.out::println);


try {
// Block size : reading one full plane at a time

Expand Down Expand Up @@ -221,7 +215,7 @@ public void run() {

DefaultTreeModel model = sourceService.getUI().getTreeModel();

opm.getAvailableWells().forEach(w -> {
opm.getWells().forEach(w -> {
int row = w.getRow().getValue() + 1;
int col = w.getColumn().getValue() + 1;
String name = getWellName(row, col);// "R" + row + "-C" + col;
Expand All @@ -231,7 +225,7 @@ public void run() {
wellFilters.put(w, sfn);
});

opm.getAvailableFieldIds().forEach(id -> {
opm.getFieldIds().forEach(id -> {
fieldsFilters.put(id,
new SourceFilterNode(model,"Field "+id,
(source) -> source.getSpimSource().getName().contains(" Field "+id+"-"),false)
Expand Down Expand Up @@ -316,7 +310,7 @@ public void run() {

int nSlices = opm.getRange().getRangeZ().size();

Well w0 = opm.getAvailableWells().get(0);
Well w0 = opm.getWells().get(0);
int row0 = w0.getRow().getValue() + 1;
int col0 = w0.getColumn().getValue() + 1;
String wellName0 = getWellName(row0, col0); // "R" + row0 + "-C" + col0;
Expand Down Expand Up @@ -360,7 +354,7 @@ public void run() {
double startX = Double.MAX_VALUE;
double startY = Double.MAX_VALUE;
// Moving in space
for (Well w : opm.getAvailableWells()) {
for (Well w : opm.getWells()) {
int row = w.getRow().getValue() + 1;
int col = w.getColumn().getValue() + 1;
String wellName = getWellName(row, col);//"R" + row + "-C" + col;
Expand Down

0 comments on commit 76c2192

Please sign in to comment.