Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

Adding elements as a sequence???
Started by mrthornhill at 11-11-2008 10:23. Topic has 13 replies.

Print Search « Previous Thread Next Thread »
  11-11-2008, 10:23
mrthornhill is not online. Last active: 11/18/2008 6:42:37 PM mrthornhill

Top 500 Posts
Joined on 11-11-2008
Posts 10
Adding elements as a sequence???
Reply Quote
Firstly, I am very new to learning the LeadTools Dicom framework, so please forgive me if I am using incorrect terminology for my question, I'll do the best I can.

I am building a dataset for performing a Modality Worklist CFind. I am using DVT to validate the CFind request I am making. I seem to have everything correct except for this ScheduledProcedureStepSequence element, and it's related elements.

The DVT script seems to expect ScheduledStationAETitle (0040 0001), ScheduledProcedureStepStartDate (0040 0002), and CTModality (0008 0060) to be part of a sequence under ScheduledProcedureStepSequence (0040 0100). If you are familiar with DVT, the script looks like this:

RECEIVE C-FIND-RQ "Modality Worklist - FIND" (
(0x00000002, "Modality Worklist Information Model - FIND SOP Class")

(0x00100010, "*") # Patient's Name
(0x00100020, "") # Patient ID
(0x0020000D, "") # Study Instance UID
(0x00400100, SQ,
>(0x00400001, "DVT") # Scheduled Station AE Title
>(0x00400002, AUTOSET) # Scheduled Procedure Step Start Date
>(0x00080060, "CT") # CT Modality
)
)

   Report 
  11-11-2008, 10:25
mrthornhill is not online. Last active: 11/18/2008 6:42:37 PM mrthornhill

Top 500 Posts
Joined on 11-11-2008
Posts 10
Re: Adding elements as a sequence???
Reply Quote
part of my post was cut off... continued here...


So I have attempted multiple approaches to inserting a sequence. Inserting the Scheduled Procedure step module, inserting the above elements with the "Sequence" flag of InsertElement set to true, etc. Nothing I've tried seems to work.

Any help you can provide would be much appreciated. Thanks!
   Report 
  11-11-2008, 14:37
mrthornhill is not online. Last active: 11/18/2008 6:42:37 PM mrthornhill

Top 500 Posts
Joined on 11-11-2008
Posts 10
Re: Adding elements as a sequence???
Reply Quote
Additionally, I am using v1.5 of the lead tools SDK, working in C#.

Thanks!
   Report 
  11-12-2008, 10:48
Adam Boulad is not online. Last active: 1/6/2009 1:25:47 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 540
Re: Adding elements as a sequence???
Reply Quote
I'm afraid that I'm not familiar with DVT. What does it do exactly? How are you using it with LEADTOOLS?
If it’s a test MWL SCP, try to use our MWL SCU demo with DVT to see if you face the same problem.
Also, try to use your application with our MWL SCP demo to see if the problem occurs.

Can you create a small sample project (not your full application) that only shows the problem and put it in a ZIP or RAR file.
You can either attach your project here (don't include serials/unlock keys and don't use the 'Preview' feature) or send it to support@leadtools.com and mention this forum post.
Adam Boulad
LEADTOOLS Technical Support

   Report 
  11-13-2008, 15:03
mrthornhill is not online. Last active: 11/18/2008 6:42:37 PM mrthornhill

Top 500 Posts
Joined on 11-11-2008
Posts 10
Re: Adding elements as a sequence???
Reply Quote
Thank you for the reply Adam.

DVT is the Dicom Validation Tool
http://www.dvtk.org/
Your MWL SCU demo also fails when used against the DVT script I am using.

But lets leave that behind as it's really not that important.


Can you simply point me to an example, or explain what the Sequence boolean flag for DicomDataset.InsertElement is for or how it would be used? For reference, here is the documentation for InsertElement.
http://www.leadtools.com/Help/LEADTOOLS/v15/DH/DI/Leadtools.Dicom~Leadtools.Dicom.DicomDataSet~InsertElement(DicomElement,Boolean,DicomTagType,DicomVRType,Boolean,Int32).html

I attached a sample dicom file, see the Scheduled Procedure Step Sequence element? How do I insert that element and it's child items into a DicomDataset that I create.

Thanks!



   Report 
  11-13-2008, 17:04
GregR is not online. Last active: 1/2/2009 9:03:27 AM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,811
Re: Adding elements as a sequence???
Reply Quote
Your dataset wasn't attached.  Here's some general guidelines for attaching files to our forum:

1.) Zip the file(s) up.
2.) Make sure it is less than 5 MB.  If it is larger, please send an email to support@leadtools.com and we'll send you FTP instructions.
3.) Remove ANY AND ALL unlock codes and LEADTOOLS DLLs.
4.) Do not click the preview button, the attachment will not show up when you post it.

If you do not wish to post your file(s) on the forum since they are publically viewable, please send an email to support@leadtools.com and make sure that you include a link to this forum post.

Greg Ross
LEADTOOLS Technical Support
   Report 
  11-14-2008, 10:31
mrthornhill is not online. Last active: 11/18/2008 6:42:37 PM mrthornhill

Top 500 Posts
Joined on 11-11-2008
Posts 10
Re: Adding elements as a sequence???
Reply Quote
sorry, I'll try again.
   Report 
  11-14-2008, 10:32
mrthornhill is not online. Last active: 11/18/2008 6:42:37 PM mrthornhill

Top 500 Posts
Joined on 11-11-2008
Posts 10
Re: Adding elements as a sequence???
Reply Quote
and I'll try again, I received an error on posting my last reply
   Report 
  11-14-2008, 10:52
mrthornhill is not online. Last active: 11/18/2008 6:42:37 PM mrthornhill

Top 500 Posts
Joined on 11-11-2008
Posts 10
Re: Adding elements as a sequence???
Reply Quote
I continue to receive errors when I attempt to attach the zip file containing my dicom dataset.
So here is a link to it hosted online.

http://dl.getdropbox.com/u/78912/Dicom_14_27_897.zip

Thanks!
   Report 
  11-16-2008, 11:59
Adam Boulad is not online. Last active: 1/6/2009 1:25:47 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 540
Re: Adding elements as a sequence???
Reply Quote
I have used the code below to add the elements as a sequence and child to the sequence. Does this do what you want? If not, please explain the problem in the results.

ds.Load(file, DicomDataSetLoadFlags.None);
DicomElement element = ds.FindFirstElement(null, DicomTagType.ScheduledProcedureStepSequence, true);
if (element == null)
{
element = ds.InsertElement(null, false, DicomTagType.ScheduledProcedureStepSequence, true, 0);
element = ds.InsertElement(element, true, DicomTagType.ScheduledStationAETitle, false, 0);
element = ds.InsertElement(element, false, DicomTagType.ScheduledProcedureStepStartDate, false, 0);
}
Adam Boulad
LEADTOOLS Technical Support

   Report 
  11-17-2008, 12:55
mrthornhill is not online. Last active: 11/18/2008 6:42:37 PM mrthornhill

Top 500 Posts
Joined on 11-11-2008
Posts 10
Re: Adding elements as a sequence???
Reply Quote
That is close but not quite right.

The tag sequence structure in the example I attached above is this:

0040:0100 - Scheduled Procedure Step Sequence
ffee:e000 - Item
0040:0001 - Scheduled Station AE Title
0040:0002 - Scheduled Procedure Step Start Date


Using your code I get:

0040:0100 - Scheduled Procedure Step Sequence
0040:0001 - Scheduled Station AE Title
0040:0002 - Scheduled Procedure Step Start Date


These are not the same.
I attempted to modify your code and insert the DicomTagType.Item, like this


DicomElement element = ds.FindFirstElement(null, DicomTagType.ScheduledProcedureStepSequence, true);
if (element == null)
{
element = ds.InsertElement(null, false, DicomTagType.ScheduledProcedureStepSequence, true, 0);
element = ds.InsertElement(element, true, DicomTagType.Item, false, 0);
element = ds.InsertElement(element, true, DicomTagType.ScheduledStationAETitle, false, 0);
element = ds.InsertElement(element, false, DicomTagType.ScheduledProcedureStepStartDate, false, 0);
}

Executing that code gives me an Insufficient Memory error at the line inserting the ScheduledProcedureStepStartDate.

Any further suggestions?
   Report 
  11-17-2008, 12:57
mrthornhill is not online. Last active: 11/18/2008 6:42:37 PM mrthornhill

Top 500 Posts
Joined on 11-11-2008
Posts 10
Re: Adding elements as a sequence???
Reply Quote
the indenting of the elements did not carry through the post, so here they are again

My example file:

0040:0100 - Scheduled Procedure Step Sequence
----ffee:e000 - Item
--------0040:0001 - Scheduled Station AE Title
--------0040:0002 - Scheduled Procedure Step Start Date


Results with your code:

0040:0100 - Scheduled Procedure Step Sequence
----0040:0001 - Scheduled Station AE Title
----0040:0002 - Scheduled Procedure Step Start Date
   Report 
  11-18-2008, 6:58
Adam Boulad is not online. Last active: 1/6/2009 1:25:47 PM Adam Boulad



Top 10 Posts
Joined on 09-16-2007
Posts 540
Re: Adding elements as a sequence???
Reply Quote
The DicomTagType.Item should be passed with the sequence flag set to true:
One way is:
element = ds.InsertElement(null, false, DicomTagType.ScheduledProcedureStepSequence, true, 0);
element = ds.InsertElement(element,true, DicomTagType.Item, true, 0);
ds.InsertElement(element, true, DicomTagType.ScheduledStationAETitle, false, 0);
ds.InsertElement(element, true, DicomTagType.ScheduledProcedureStepStartDate, false, 0);

Another way is:
element = ds.InsertElement(null, false, DicomTagType.ScheduledProcedureStepSequence, true, 0);
element = ds.InsertElement(element,true, DicomTagType.Item, true, 0);
element = ds.InsertElement(element, true, DicomTagType.ScheduledStationAETitle, false, 0);
element = ds.InsertElement(element, false, DicomTagType.ScheduledProcedureStepStartDate, false, 0);
Adam Boulad
LEADTOOLS Technical Support

   Report 
  11-18-2008, 13:43
mrthornhill is not online. Last active: 11/18/2008 6:42:37 PM mrthornhill

Top 500 Posts
Joined on 11-11-2008
Posts 10
Re: Adding elements as a sequence???
Reply Quote
Thank you Adam, I actually came to the solution yesterday and forgot to post back here. I appreciate your assistance, your help definitely pushed me towards the solution.
   Report 
Post
LEAD Support Fo... » Developer » DICOM/Medical I... » Adding elements as a sequence???

Powered by Community Server, by Telligent Systems