/**
   * Construct a Study from an ArrayList of series.
   *
   * @param series
   */
  public CachedJPEGStudy(ArrayList<CachedJPEGSeries> series) {

    addAll(series);
    if (!isEmpty()) {
      CachedJPEGSeries cjs = (CachedJPEGSeries) series.get(0);
      CachedJPEGHeader cjh = cjs.getHeader();
      String description = cjh.getDescription();
      if (description != null) setProperty(DESCRIPTION, description);
      setProperty(NUMBER_SERIES, groups.size());
      registerModel();
    } else {
      System.err.println("Empty study due to image reading problems, check log.");
    }
  }
 public Object getClosingKey() {
   CachedJPEGHeader cjh = getHeader();
   return (cjh != null) ? cjh.getStudyUID() : this;
 }
 public Object getDependentKey() {
   CachedJPEGHeader cjh = getHeader();
   return (cjh != null) ? cjh.getPatientID() : this;
 }