private void checkMetadata(NXentry entry, List<ScanMetadata> scanMetadataList) {
    for (ScanMetadata scanMetadata : scanMetadataList) {
      MetadataType type = scanMetadata.getType();
      NXobject object = getNexusObjectForMetadataType(entry, type);

      Map<String, Object> metadataFields = scanMetadata.getFields();
      for (String metadataFieldName : metadataFields.keySet()) {
        Object expectedValue = scanMetadata.getFieldValue(metadataFieldName);

        Dataset dataset = DatasetUtils.convertToDataset(object.getDataset(metadataFieldName));
        assertNotNull(dataset);
        assertEquals(1, dataset.getSize());
        assertEquals(DTypeUtils.getDTypeFromObject(expectedValue), dataset.getDType());
        assertEquals(expectedValue, dataset.getObjectAbs(0));
      }
    }
  }
 @Override
 public IDataset processImage(IDataset dataset, IMonitor monitor) {
   int dtype = DTypeUtils.getDType(dataset);
   int radius = ((KernelWidthModel) model).getWidth();
   return Image.pseudoFlatFieldFilter(DatasetUtils.cast(dataset, dtype), radius);
 }