001/******************************************************************************* 002 * Permission to use and distribute this software is granted under the BSD 2-Clause 003 * "Simplified" License (see http://opensource.org/licenses/BSD-2-Clause). 004 * Copyright (c) 2016-2023 Wilhelm Burger. All rights reserved. 005 * Visit https://imagingbook.com for additional details. 006 ******************************************************************************/ 007package imagingbook.calibration.zhang.data; 008 009import imagingbook.core.resource.ImageResource; 010 011public enum CalibrationImage implements ImageResource { 012 CalibImageStack("CalibImageStack.tif"), 013 CalibIm1, 014 CalibIm2, 015 CalibIm3, 016 CalibIm4, 017 CalibIm5, 018 marked1, 019 marked2, 020 marked3, 021 marked4, 022 marked5; 023 024 // private final static String BASEDIR = "DATA"; 025 private final String filename; 026 027 CalibrationImage() { 028 this(null); 029 } 030 031 CalibrationImage(String filename) { 032 this.filename = filename; 033 } 034 035 @Override 036 public String getFileName() { 037 return (this.filename != null) ? this.filename : this.autoName(); 038 } 039 040 // @Override 041 // public String getRelativeDirectory() { 042 // return BASEDIR; 043 // } 044 045 046 String getAbsolutePath() { 047 return this.getClass().getResource("") + "/" + getRelativeDirectory() + "/" + getFileName(); 048 } 049 050}