Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, November 11, 2008 5:18:54 AM(UTC)
mrthornhill

Groups: Registered
Posts: 10


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
)
)
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, November 11, 2008 5:20:43 AM(UTC)
mrthornhill

Groups: Registered
Posts: 10


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!
 
#3 Posted : Tuesday, November 11, 2008 9:32:27 AM(UTC)
mrthornhill

Groups: Registered
Posts: 10


Additionally, I am using v1.5 of the lead tools SDK, working in C#.

Thanks!
 
#4 Posted : Wednesday, November 12, 2008 5:43:55 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

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.
 
#5 Posted : Thursday, November 13, 2008 9:58:14 AM(UTC)
mrthornhill

Groups: Registered
Posts: 10


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!


 
#6 Posted : Thursday, November 13, 2008 11:59:17 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


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.
 
#7 Posted : Friday, November 14, 2008 5:26:10 AM(UTC)
mrthornhill

Groups: Registered
Posts: 10


sorry, I'll try again.
 
#8 Posted : Friday, November 14, 2008 5:27:11 AM(UTC)
mrthornhill

Groups: Registered
Posts: 10


and I'll try again, I received an error on posting my last reply
 
#9 Posted : Friday, November 14, 2008 5:47:22 AM(UTC)
mrthornhill

Groups: Registered
Posts: 10


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!
 
#10 Posted : Sunday, November 16, 2008 6:54:08 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

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);
}
 
#11 Posted : Monday, November 17, 2008 7:50:45 AM(UTC)
mrthornhill

Groups: Registered
Posts: 10


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?
 
#12 Posted : Monday, November 17, 2008 7:52:14 AM(UTC)
mrthornhill

Groups: Registered
Posts: 10


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
 
#13 Posted : Tuesday, November 18, 2008 1:53:13 AM(UTC)

Adam Boulad  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

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);
 
#14 Posted : Tuesday, November 18, 2008 8:38:09 AM(UTC)
mrthornhill

Groups: Registered
Posts: 10


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.
 
#15 Posted : Tuesday, January 24, 2012 5:22:17 AM(UTC)

zliu  
zliu

Groups: Registered
Posts: 8


What is the purpose of inserting Item as a middle layer between ScheduledProcedureStepSequence tag and ScheduledStationAETitle ?
Why cannot we simply add ScheduledStationAETitle directly as the direct child of ScheduledProcedureStepSequence ?
 
#16 Posted : Tuesday, January 24, 2012 9:42:46 AM(UTC)

Travis  
Travis

Groups: Registered, Tech Support
Posts: 207

Was thanked: 3 time(s) in 3 post(s)

This is due to the encoding rules of a sequence as defined in the DICOM specification.

See PS 3.5 section, 7.5 Nesting of Data Sets, 7.5.1 Item Encoding Rules, 7.5.2 Delimitation of the Sequence of Items.

I have also attached an image from the DICOM Specification showing an example:


Travis attached the following image(s):
Table7.5-2.jpg
Travis Montgomery
Senior Sales Engineer
LEAD Logo
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.215 seconds.