DCMSeg - error on createBinarySegmentation

Third-party non-commercial applications based on the DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
jaas
Posts: 1
Joined: Fri, 2018-11-09, 14:23

DCMSeg - error on createBinarySegmentation

#1 Post by jaas »

Hi all,

I am trying to associate DCMTK with a third-party application to use DICOM Segmentation.

I built DCMTK, added it to the project but when I call the method to create the binary segmentation file using:

Code: Select all

DcmSegmentation *segdoc = NULL;

OFCondition result = DcmSegmentation::createBinarySegmentation(segdoc, inputSize[1], inputSize[0], eq, ident);
With inputSize equal to:

Code: Select all

(itk::Image<short, 3>::SizeType) inputSize = {
  m_Size = ([0] = 640, [1] = 640, [2] = 33)
}
eq:

Code: Select all

(IODGeneralEquipmentModule::EquipmentInfo) eq = {
  m_Manufacturer = (theCString = "Test", theSize = 9, theCapacity = 9)
  m_ManufacturerModelName = (theCString = "0", theSize = 1, theCapacity = 1)
  m_DeviceSerialNumber = (theCString = "GetDicomSeg", theSize = 16, theCapacity = 16)
  m_SoftwareVersions = (theCString = "v1.0.0", theSize = 6, theCapacity = 6)
}
ident:

Code: Select all

(ContentIdentificationMacro) ident = {
  m_InstanceNumber = {
    DcmByteString = {
      DcmElement = {
        DcmObject = {
          errorFlag = {
            theCondition = (theModule = 0, theCode = 0, theStatus = OF_ok, theText = "Normal")
            ownsText = false
          }
          Tag = {
            DcmTagKey = (group = 32, element = 19)
            vr = (vr = EVR_UNKNOWN)
            tagName = 0x0000000000000000
            privateCreator = 0x0000000000000000
            errorFlag = {
              theCondition = (theModule = 1, theCode = 1, theStatus = OF_error, theText = "Invalid tag")
              ownsText = false
            }
          }
          Length = 2
          fTransferState = ERW_init
          fTransferredBytes = 0
          Parent = 0x0000000000000000
        }
        fByteOrder = EBO_LittleEndian
        fLoadValue = 0x0000000000000000
        fValue = 0x00007fc85b26c540 "1"
      }
      paddingChar = ' '
      maxLength = 12
      realLength = 1
      fStringMode = DCM_MachineString
      nonSignificantChars = (theCString = " \\", theSize = 2, theCapacity = 2)
    }
  }
  m_ContentLabel = {
    DcmByteString = {
      DcmElement = {
        DcmObject = {
          errorFlag = {
            theCondition = (theModule = 0, theCode = 0, theStatus = OF_ok, theText = "Normal")
            ownsText = false
          }
          Tag = {
            DcmTagKey = (group = 112, element = 128)
            vr = (vr = EVR_UNKNOWN)
            tagName = 0x0000000000000000
            privateCreator = 0x0000000000000000
            errorFlag = {
              theCondition = (theModule = 1, theCode = 1, theStatus = OF_error, theText = "Invalid tag")
              ownsText = false
            }
          }
          Length = 12
          fTransferState = ERW_init
          fTransferredBytes = 0
          Parent = 0x0000000000000000
        }
        fByteOrder = EBO_LittleEndian
        fLoadValue = 0x0000000000000000
        fValue = 0x00007fc85a67dd80 "SEGMENTATION"
      }
      paddingChar = ' '
      maxLength = 16
      realLength = 12
      fStringMode = DCM_MachineString
      nonSignificantChars = (theCString = " \\", theSize = 2, theCapacity = 2)
    }
  }
  m_ContentDescription = {
    DcmCharString = {
      DcmByteString = {
        DcmElement = {
          DcmObject = {
            errorFlag = {
              theCondition = (theModule = 0, theCode = 0, theStatus = OF_ok, theText = "Normal")
              ownsText = false
            }
            Tag = {
              DcmTagKey = (group = 112, element = 129)
              vr = (vr = EVR_UNKNOWN)
              tagName = 0x0000000000000000
              privateCreator = 0x0000000000000000
              errorFlag = {
                theCondition = (theModule = 1, theCode = 1, theStatus = OF_error, theText = "Invalid tag")
                ownsText = false
              }
            }
            Length = 18
            fTransferState = ERW_init
            fTransferredBytes = 0
            Parent = 0x0000000000000000
          }
          fByteOrder = EBO_LittleEndian
          fLoadValue = 0x0000000000000000
          fValue = 0x00007fc84f516980 "DICOM Segmentation"
        }
        paddingChar = ' '
        maxLength = 64
        realLength = 18
        fStringMode = DCM_MachineString
        nonSignificantChars = (theCString = " \\", theSize = 2, theCapacity = 2)
      }
    }
  }
  m_AlternateContentDescription = {
    values_ = 0x0000000000000000
    allocated_ = 0
    size_ = 0
  }
  m_ContentCreatorName = {
    DcmCharString = {
      DcmByteString = {
        DcmElement = {
          DcmObject = {
            errorFlag = {
              theCondition = (theModule = 0, theCode = 0, theStatus = OF_ok, theText = "Normal")
              ownsText = false
            }
            Tag = {
              DcmTagKey = (group = 112, element = 132)
              vr = (vr = EVR_UNKNOWN)
              tagName = 0x0000000000000000
              privateCreator = 0x0000000000000000
              errorFlag = {
                theCondition = (theModule = 1, theCode = 1, theStatus = OF_error, theText = "Invalid tag")
                ownsText = false
              }
            }
            Length = 4
            fTransferState = ERW_init
            fTransferredBytes = 0
            Parent = 0x0000000000000000
          }
          fByteOrder = EBO_LittleEndian
          fLoadValue = 0x0000000000000000
          fValue = 0x00007fc853e747b0 "asd"
        }
        paddingChar = ' '
        maxLength = 64
        realLength = 3
        fStringMode = DCM_MachineString
        nonSignificantChars = (theCString = " \\^=", theSize = 4, theCapacity = 4)
      }
    }
  }
  m_ContentCreatorIdentificationCode = {
    IODComponent = {
      m_Item = {
        m_pData = 0x00007fc856fad250
      }
      m_Rules = {
        m_pData = 0x00007fc856fdc830
      }
      m_Parent = 0x0000000000000000
    }
  }
  m_IODRules = {
    m_Rules = {
      values_ = {
        OFListBase = {
          afterLast = 0x00007fc856fae170
          listSize = 6
        }
      }
    }
  }
}
I get the following result:

Code: Select all

(OFCondition) result = {
  theCondition = (theModule = 1, theCode = 42, theStatus = OF_error, theText = "Invalid Value")
  ownsText = false
}
I would like to know if you might have an idea of what might be causing this, the call is practically the same as what's done in https://github.com/QIICR/dcmqi

Thank you for your time.

Best,
Joao

Michael Onken
DCMTK Developer
Posts: 2048
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: DCMSeg - error on createBinarySegmentation

#2 Post by Michael Onken »

Hi,

you have to fill in all values on the equipment struct, right now Manufacturer's Model Name is empty.

I will add a related hint in the API documentation of the create... methods.

Best regards,
Michael

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest