"Unsupported SOP Class: " + mfcuid);
return impl;
}
private Attributes extract(Attributes emf, int frame, String cuid) {
Attributes sfgs = emf.getNestedDataset(Tag.SharedFunctionalGroupsSequence);
if (sfgs == null)
throw new IllegalArgumentException(
"Missing (5200,9229) Shared Functional Groups Sequence");
Attributes fgs = emf.getNestedDataset(Tag.PerFrameFunctionalGroupsSequence, frame);
if (fgs == null)
throw new IllegalArgumentException(
"Missing (5200,9230) Per-frame Functional Groups Sequence Item for frame #" + (frame + 1));
Attributes dest = new Attributes(emf.size() * 2);
dest.addNotSelected(emf, EXCLUDE_TAGS);
addFunctionGroups(dest, sfgs);
addFunctionGroups(dest, fgs);
addPixelData(dest, emf, frame);
dest.setString(Tag.SOPClassUID, VR.UI, cuid);
dest.setString(Tag.SOPInstanceUID, VR.UI, uidMapper.get(
dest.getString(Tag.SOPInstanceUID)) + '.' + (frame + 1));
dest.setString(Tag.InstanceNumber, VR.IS,
createInstanceNumber(dest.getString(Tag.InstanceNumber, ""), frame));
dest.setString(Tag.ImageType, VR.CS, dest.getStrings(Tag.FrameType));
dest.remove(Tag.FrameType);
if (!preserveSeriesInstanceUID)
dest.setString(Tag.SeriesInstanceUID, VR.UI, uidMapper.get(
dest.getString(Tag.SeriesInstanceUID)));
adjustReferencedImages(dest, Tag.ReferencedImageSequence);
adjustReferencedImages(dest, Tag.SourceImageSequence);
return dest;
}