private void storeDiffs(Preferences prefs, ImageWriterParam prev, ImageWriterParam param) { if (prev != null) { PreferencesUtils.storeDiff(prefs, "dcmIIOFormatName", prev.formatName, param.formatName); PreferencesUtils.storeDiff(prefs, "dcmJavaClassName", prev.className, param.className); PreferencesUtils.storeDiff(prefs, "dcmPatchJPEGLS", prev.patchJPEGLS, param.patchJPEGLS); PreferencesUtils.storeDiff( prefs, "dcmImageWriteParam", prev.getImageWriteParams(), param.getImageWriteParams()); } else storeTo(param, prefs); }
private ImageWriterParam load(Preferences prefs) { return new ImageWriterParam( prefs.get("dcmIIOFormatName", null), prefs.get("dcmJavaClassName", null), prefs.get("dcmPatchJPEGLS", null), PreferencesUtils.stringArray(prefs, "dcmImageWriteParam")); }
private void storeTo(ImageWriterParam param, Preferences prefs) { prefs.put("dcmIIOFormatName", param.formatName); PreferencesUtils.storeNotNull(prefs, "dcmJavaClassName", param.className); PreferencesUtils.storeNotNull(prefs, "dcmPatchJPEGLS", param.patchJPEGLS); PreferencesUtils.storeNotEmpty(prefs, "dcmImageWriteParam", param.getImageWriteParams()); }