ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Edge case bug in TIEDicomTags.SetTag

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
yeohray2 Posted - Dec 03 2021 : 05:32:49
In the SetTag function, the tags are incorrectly deleted if the sequence tag was not sorted, that tag already exists, and the ReplaceIfExist flag is true.

  idx := -1;  //  this is the start

  if fSorted then  //  is false for sequences i.e. nested DICOM groups
  ...

  if idx > -1 then  //  we won't go in here because idx is still -1
  begin
  ...
  else
  begin
    // append to the end
    idx := fTags.Add(tag);  //  we'll hit this code, so idx will be > 0, as the same tag already exists
  end;


  //  at this point, we have at least 2 identical tags, the old one and the new one.  
  if ReplaceIfExist then
  begin
    // remove possible other replications
    i := 0;
    while i < fTags.Count do
    begin
      if (PIEDicomTag(fTags[i])^.Group = Tag^.Group) and (PIEDicomTag(fTags[i])^.Element = Tag^.Element) and (i <> idx) then
        DeleteTag(i)  //  the old tag will be deleted, which is correct, but because i is not incremented, the new tag will also be deleted as i <> idx (of the new tag)
      else
        inc(i);
    end;
  end;


For now, I've just set the sorted flag to true, though I would prefer not to do that.

Thanks.
Ray
2   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Dec 09 2021 : 17:52:09
Hi Ray

We have a fix available for this. Please email me.

Nigel
Xequte Software
www.imageen.com
xequte Posted - Dec 04 2021 : 15:08:41
Thanks Ray,

We'll check that.

Nigel
Xequte Software
www.imageen.com