Example #1
0
 /** Create a metadata row from another metadata Adding the activeLabels and adding an object */
 public MetaData getMetaDataRow() {
   MetaData md = null;
   try {
     md = new MetaData();
     md.setColumnFormat(false);
     int[] labels = getActiveLabels();
     for (int l : labels) md.addLabel(l);
     md.addObject();
   } catch (Exception e) {
     e.printStackTrace();
   }
   return md;
 }
Example #2
0
 public static boolean containsBlock(String file, String block) {
   try {
     return Arrays.asList(MetaData.getBlocksInMetaDataFile(file)).contains(block);
   } catch (Exception e) {
     throw new IllegalArgumentException(e);
   }
 } // function containsBlock
Example #3
0
  public EllipseCTF getEllipseCTF(long id, int D) {
    MetaData md = new MetaData(getCTFFile(id));
    try {
      double Q0, Cs, Ts, kV, downsampleFactor, defU, defV, defAngle;

      Q0 = md.getValueDouble(MDLabel.MDL_CTF_Q0, id);
      Cs = md.getValueDouble(MDLabel.MDL_CTF_CS, id);
      downsampleFactor = md.getValueDouble(MDLabel.MDL_CTF_DOWNSAMPLE_PERFORMED, id);
      Ts = md.getValueDouble(MDLabel.MDL_CTF_SAMPLING_RATE, id) * downsampleFactor;
      kV = md.getValueDouble(MDLabel.MDL_CTF_VOLTAGE, id);

      defU = md.getValueDouble(MDLabel.MDL_CTF_DEFOCUSU, id);
      defV = md.getValueDouble(MDLabel.MDL_CTF_DEFOCUSV, id);
      defAngle = md.getValueDouble(MDLabel.MDL_CTF_DEFOCUS_ANGLE, id);

      return new EllipseCTF(id, Q0, Cs, downsampleFactor, Ts, kV, defU, defV, defAngle, D);
    } catch (Exception ex) {
      IJ.error(ex.getMessage());
      throw new IllegalArgumentException(ex);
    }
  }