Changeset 5784


Ignore:
Timestamp:
Dec 12, 2019, 8:30:08 AM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #1214: Add support for external specimen

Histology images for external specimen got an incorrect folder location (eg. /home/SCANB/HistologyImagesNN_External.his.he1/). The code has been fixed to place external histology images in /home/External/HistologyImages/NN/ where NN is the prefix before the first underscore in the specimen name.

Location:
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/dao/Histology.java

    r5320 r5784  
    4949  */
    5050  public static final String IMAGE_DIR = "/home/SCANB/HistologyImages";
    51  
     51
     52  /**
     53    Path on BASE file system to histology images for external specimen.
     54    @since 4.25
     55  */
     56  public static final String EXTERNAL_IMAGE_DIR = "/home/External/HistologyImages";
     57   
    5258 
    5359  /**
     
    6066    the first four digits.
    6167   
     68    For external items the prefix is the taken from the characters before
     69    the first underscore (_).   
    6270   
    6371    Examples:
    64       1234567.1.his.he1 --> /12/1234/
    65     @since 3.6
     72      1234567.1.his.he1 --> {IMAGE_DIR}/12/1234/
     73      NN_External.his.he1 --> {EXTERNAL_IMAGE_DIR}/NN/
     74     
     75    @since 3.6, 4.25
    6676  */
    6777  public static String getImageFolder(String name)
    6878  {
    69     // If the name starts with 7 digits+'.'+at least one more digit
    70     // insert prefix based on first 2+4 digits
    71     return name.replaceFirst("^((\\d{2})\\d{2})\\d{3}\\.\\d+.*", "/$2/$1/");
     79    if (Reggie.isExternalItem(name))
     80    {
     81      // Get characters before first _
     82      return Histology.EXTERNAL_IMAGE_DIR + name.replaceFirst("^(.+?)_.*", "/$1/");
     83    }
     84    else
     85    {
     86      // If the name starts with 7 digits+'.'+at least one more digit
     87      // insert prefix based on first 2+4 digits
     88      return Histology.IMAGE_DIR + name.replaceFirst("^((\\d{2})\\d{2})\\d{3}\\.\\d+.*", "/$2/$1/");
     89    }
    7290  }
    7391
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/HistologyServlet.java

    r5432 r5784  
    993993        if (imageFile == null)
    994994        {
    995           String path = Histology.IMAGE_DIR + Histology.getImageFolder(his.getName());
     995          String path = Histology.getImageFolder(his.getName());
    996996         
    997997          Directory imageDir = Directory.getNew(dc, new Path(path, Path.Type.DIRECTORY));
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/servlet/InstallServlet.java

    r5774 r5784  
    10451045        // Directories
    10461046        jsonChecks.add(checkDirectory(dc, Histology.IMAGE_DIR, createIfMissing, effectivePermissionsUse));
     1047        jsonChecks.add(checkDirectory(dc, Histology.EXTERNAL_IMAGE_DIR, createIfMissing, effectivePermissionsUse));
    10471048        jsonChecks.add(checkDirectory(dc, DemuxJobCreator.DEMULTIPLEX_METRICS_DIR, createIfMissing, effectivePermissionsUse));
    10481049        jsonChecks.add(checkDirectory(dc, Reggie.FROZEN_TISSUE_FILES, createIfMissing, patientCuratorUse));
Note: See TracChangeset for help on using the changeset viewer.