what dose "((status==0)||((status & 0xf000)==0xb000))" do?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Emma_cao
Posts: 13
Joined: Mon, 2016-12-05, 10:51

what dose "((status==0)||((status & 0xf000)==0xb000))" do?

#1 Post by Emma_cao »

In Printing process, after creatRQ(...) in function DVPSStoredPrint::printSCUcreateBasicFilmSession(...),DVPSStoredPrint::printSCUcreateBasicFilmBox(...),and actionRQ(...) in function DVPSStoredPrint::printSCUcreateBasicFilmBox(...)...
there will be a judgment statement "((status==0)||((status & 0xf000)==0xb000))", what does this code do and and is it indispensable?

Thanks.

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: what dose "((status==0)||((status & 0xf000)==0xb000))" do?

#2 Post by J. Riesmeier »

A DIMSE status code of "0000" means "Success" (i.e. no error, no warning). A DIMSE status of "Bxxx" (16-bit hexadecimal, starting with "B") means a warning. See DICOM standard for details.

So, "((status==0)||((status & 0xf000)==0xb000))" will only be true, if no error occurred.

Emma_cao
Posts: 13
Joined: Mon, 2016-12-05, 10:51

Re: what dose "((status==0)||((status & 0xf000)==0xb000))" do?

#3 Post by Emma_cao »

Thanks Your reply.

We met a FUJI Printer in a hospital, the log is following when create Basic Film Box:

- ==================================== create Basic Film Box: CRAETE RQ ====================================
-request.CommandField: 320
-request.msg.NCreateRQ.MessageID: 3
-request.msg.NCreateRQ.AffectedSOPClassUID: 1.2.840.10008.5.1.1.2
-request.msg.NCreateRQ.AffectedSOPInstanceUID:
-request.msg.NCreateRQ.DataSetType: 1
- attributeListIn--------------------------------------------------------------
- tag = (0008,0005), tagName = SpecificCharacterSet, ----- tagValue = ISO_IR 192
- tag = (2010,0010), tagName = ImageDisplayFormat, ----- tagValue = STANDARD\1,1
- tag = (2010,0040), tagName = FilmOrientation, ----- tagValue = PORTRAIT
- tag = (2010,0050), tagName = FilmSizeID, ----- tagValue = 14INX17IN
- tag = (2010,0060), tagName = MagnificationType, ----- tagValue = CUBIC
- tag = (2010,0080), tagName = SmoothingType, ----- tagValue = SHARP
- tag = (2010,0100), tagName = BorderDensity, ----- tagValue = BLACK
- tag = (2010,0110), tagName = EmptyImageDensity, ----- tagValue = BLACK
- tag = (2010,0120), tagName = MinDensity, ----- tagValue = 20
- tag = (2010,0130), tagName = MaxDensity, ----- tagValue = 300
- tag = (2010,0140), tagName = Trim, ----- tagValue = NO
- tag = (2010,0150), tagName = ConfigurationInformation, ----- tagValue = 1
- tag = (2010,015e), tagName = Illumination, ----- tagValue = 2000
- tag = (2010,0160), tagName = ReflectedAmbientLight, ----- tagValue = 10
- tag = (2010,0500), tagName = ReferencedFilmSessionSequence, ----- tagValue =
- tag = (fffe,e000), tagName = Item, ----- tagValue =
- tag = (0008,1150), tagName = ReferencedSOPClassUID, ----- tagValue = 1.2.840.10008.5.1.1.1
- tag = (0008,1155), tagName = ReferencedSOPInstanceUID, ----- tagValue = 1.2.392.200036.9125.5.16243109232244.20190705135138.87
- tag = (2020,0050), tagName = RequestedResolutionID, ----- tagValue = STANDARD
- attributeListOut--------------------------------------------------------------
- tag = (0008,0005), tagName = SpecificCharacterSet, ----- tagValue = ISO_IR 192
- tag = (2010,0000), tagName = GenericGroupLength, ----- tagValue = 428
- tag = (2010,0010), tagName = ImageDisplayFormat, ----- tagValue = STANDARD\1,1
- tag = (2010,0040), tagName = FilmOrientation, ----- tagValue = PORTRAIT
- tag = (2010,0050), tagName = FilmSizeID, ----- tagValue = 14INX17IN
- tag = (2010,0060), tagName = MagnificationType, ----- tagValue = CUBIC
- tag = (2010,0080), tagName = SmoothingType, ----- tagValue = SHARP
- tag = (2010,0100), tagName = BorderDensity, ----- tagValue = BLACK
- tag = (2010,0120), tagName = MinDensity, ----- tagValue = 20
- tag = (2010,0130), tagName = MaxDensity, ----- tagValue = 300
- tag = (2010,0140), tagName = Trim, ----- tagValue = NO
- tag = (2010,0150), tagName = ConfigurationInformation, ----- tagValue = 1
- tag = (2010,015e), tagName = Illumination, ----- tagValue = 2000
- tag = (2010,0160), tagName = ReflectedAmbientLight, ----- tagValue = 10
- tag = (2010,0500), tagName = ReferencedFilmSessionSequence, ----- tagValue =
- tag = (fffe,e000), tagName = Item, ----- tagValue =
- tag = (0008,0000), tagName = GenericGroupLength, ----- tagValue = 92
- tag = (0008,1150), tagName = ReferencedSOPClassUID, ----- tagValue = 1.2.840.10008.5.1.1.1
- tag = (0008,1155), tagName = ReferencedSOPInstanceUID, ----- tagValue = 1.2.392.200036.9125.5.16243109232244.20190705135138.87
- tag = (2010,0510), tagName = ReferencedImageBoxSequence, ----- tagValue =
- tag = (fffe,e000), tagName = Item, ----- tagValue =
- tag = (0008,0000), tagName = GenericGroupLength, ----- tagValue = 92
- tag = (0008,1150), tagName = ReferencedSOPClassUID, ----- tagValue = 1.2.840.10008.5.1.1.4
- tag = (0008,1155), tagName = ReferencedSOPInstanceUID, ----- tagValue = 1.2.392.200036.9125.7.16243109232244.20190705135139.89
- tag = (2020,0000), tagName = GenericGroupLength, ----- tagValue = 16
- tag = (2020,0050), tagName = RequestedResolutionID, ----- tagValue = STANDARD
-response.msg.NCreateRSP.DimseStatus: 263
-response.msg.NCreateRSP.MessageIDBeingRespondedTo: 3
-response.msg.NCreateRSP.AffectedSOPClassUID: 1.2.840.10008.5.1.1.2
-response.msg.NCreateRSP.AffectedSOPInstanceUID: 1.2.392.200036.9125.6.16243109232244.20190705135139.88
-response.msg.NCreateRQ.DataSetType: 0

the response.msg.NCreateRSP.DimseStatus 263 means "Attribute list error".
If I delete the atrribute "EmptyImageDensity", the response.msg.NCreateRSP.DimseStatus will be 0, then the printer will print normally.

But I think the attribute "EmptyImageDensity" is a common characteristic, Do you have a good way to deal with this kind of problem?

Best Wishes!

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: what dose "((status==0)||((status & 0xf000)==0xb000))" do?

#4 Post by J. Riesmeier »

The DICOM standard states in PS3.4 Section H.2.4:
If the SCP does not support the Attribute specified by the SCU, it shall return either a Failure status ("No Such Attribute", code 0105H) or return a Warning status ("Attribute List Error", code 0107H.)). In the case of Warning status, the behavior of the SCP is defined in​ the SCP Conformance Statement.​

Emma_cao
Posts: 13
Joined: Mon, 2016-12-05, 10:51

Re: what dose "((status==0)||((status & 0xf000)==0xb000))" do?

#5 Post by Emma_cao »

So "Attribute list error" is a warning status, the code is 0107H, but it does not make ((status & 0xf000)==0xb000)) true. Is that right?

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: what dose "((status==0)||((status & 0xf000)==0xb000))" do?

#6 Post by J. Riesmeier »

Yes, this is how I interpret the DICOM standard. I guess it would be better to use the following macro (from "dcmnet/dimse.h") in order to check for a warning DIMSE status code:

Code: Select all

#define DICOM_WARNING_STATUS(status) ((((status) & 0xf000) == 0xb000) || ((status) == 0x0107) || ((status) == 0x0116))
Maybe, Marco who developed this part (print management) of the DCMTK can comment on this.

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: what dose "((status==0)||((status & 0xf000)==0xb000))" do?

#7 Post by J. Riesmeier »

As I suspected, this seems to be a bug in the implementation; Marco confirmed this. So, I added the following issue to DCMTK's bug tracker: https://support.dcmtk.org/redmine/issues/894

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest