Urgenr! JPEG or Default Transfer Syntax to Choose? - DICOM

This is a discussion on Urgenr! JPEG or Default Transfer Syntax to Choose? - DICOM ; Hi all I am converting a jpeg image files to DICOM format ..I am getting images scanned from a jpeg scanner and s having them in jpg format.The library I am using, for converting jpeg to DICOM, does not encodes ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Urgenr! JPEG or Default Transfer Syntax to Choose?

  1. Urgenr! JPEG or Default Transfer Syntax to Choose?

    Hi all I am converting a jpeg image files to DICOM format
    ..I am getting images scanned from a jpeg scanner and s
    having them in jpg format.The library I am using, for converting
    jpeg to DICOM, does not encodes the actual pixel data though it can
    encode other Data Elements.In brief I am doing following:

    a) Create a new DICOM Instance
    b) Add all the tags as per selected IOD to DICOM
    instance
    c) When Pixel Data tag is encountered then
    Pixel Data(7FE0,0010)= jpeg pixel data from
    jpeg file
    d)Finally save the resulting DICOM file.

    I need following clarifications:

    a) Should I use "Default DICOM Transfer Syntax"
    i.e 1.2.840.10008.1.2 or i should use "JPEG
    Lossy Transfer Syntax" i.e 1.2.840.10008.1.2.4.50
    (for 8-bit) and 1.2.840.10008.1.2.4.51 (for 12 bit),
    since I will be copying pixels data of jpeg file to
    "Pixel Data" element(7FE0,0010) of the resulting DICOM
    file??Since in actual i wont be encoding that jpeg
    pixel that as per jpeg transfer syntax though it is jpeg
    pixel data.

    b). No doubt i will be encoding other data elements as per
    Part -5 but when copying jpeg pixel data from a jpeg
    file, to the "Pixel Data" element(7FE0,0010) of
    resulting DICOM file ,I guess I am not encapsulating
    it as per jpeg lossy transfer syntax defined by
    DICOM i.e Part-5 "Table A.4-1" ?? Please clarify!

    c) After copying the jpeg pixel data from my jpeg file
    to "Pixel Data" element of resulting DICOM file ,
    then will that DICOM file be interpreted by DICOM
    viewers clearly i.e. image will be clearly viewable,
    without any loss or degrading of image quality ??

    Since if i go for Jpeg Tranfer Syntax UID , though
    my pixel data will be jpeg but not encoded as per
    DICOM JPEG Transfer Syntax and if i go for DICOM
    Default Transfer Syntax , then in actual my pixel
    data will be jpeg but transfer syntax will imply
    it is Uncompressed.

    Waiting for your reply.Thanks in advance

    Navdeep


  2. Re: Urgenr! JPEG or Default Transfer Syntax to Choose?

    On Feb 5, 2:39 pm, navdeepr...@gmail.com wrote:
    > Hi all I am converting a jpeg image files to DICOM format
    > .I am getting images scanned from a jpeg scanner and s
    > having them in jpg format.The library I am using, for converting
    > jpeg to DICOM, does not encodes the actual pixel data though it can
    > encode other Data Elements.In brief I am doing following:
    >
    > a) Create a new DICOM Instance
    > b) Add all the tags as per selected IOD to DICOM
    > instance
    > c) When Pixel Data tag is encountered then
    > Pixel Data(7FE0,0010)= jpeg pixel data from
    > jpeg file
    > d)Finally save the resulting DICOM file.
    >
    > I need following clarifications:
    >
    > a) Should I use "Default DICOM Transfer Syntax"
    > i.e 1.2.840.10008.1.2 or i should use "JPEG
    > Lossy Transfer Syntax" i.e 1.2.840.10008.1.2.4.50
    > (for 8-bit) and 1.2.840.10008.1.2.4.51 (for 12 bit),
    > since I will be copying pixels data of jpeg file to
    > "Pixel Data" element(7FE0,0010) of the resulting DICOM
    > file??Since in actual i wont be encoding that jpeg
    > pixel that as per jpeg transfer syntax though it is jpeg
    > pixel data.
    >
    > b). No doubt i will be encoding other data elements as per
    > Part -5 but when copying jpeg pixel data from a jpeg
    > file, to the "Pixel Data" element(7FE0,0010) of
    > resulting DICOM file ,I guess I am not encapsulating
    > it as per jpeg lossy transfer syntax defined by
    > DICOM i.e Part-5 "Table A.4-1" ?? Please clarify!
    >
    > c) After copying the jpeg pixel data from my jpeg file
    > to "Pixel Data" element of resulting DICOM file ,
    > then will that DICOM file be interpreted by DICOM
    > viewers clearly i.e. image will be clearly viewable,
    > without any loss or degrading of image quality ??
    >
    > Since if i go for Jpeg Tranfer Syntax UID , though
    > my pixel data will be jpeg but not encoded as per
    > DICOM JPEG Transfer Syntax and if i go for DICOM
    > Default Transfer Syntax , then in actual my pixel
    > data will be jpeg but transfer syntax will imply
    > it is Uncompressed.
    >
    > Waiting for your reply.Thanks in advance
    >
    > Navdeep


    I am waiting for reply from you techies! Thanks in advance......

  3. Re: Urgenr! JPEG or Default Transfer Syntax to Choose?

    On Feb 6, 9:22*am, navdeepr...@gmail.com wrote:
    > On Feb 5, 2:39 pm, navdeepr...@gmail.com wrote:
    >
    >
    >
    >
    >
    > > Hi all I am converting a jpeg image files to DICOM format
    > > .I am getting images scanned from a jpeg scanner and s
    > > having them in jpg format.The library I am using, for converting
    > > *jpeg to DICOM, does not encodes the actual pixel data though it can
    > > encode other Data Elements.In brief I am doing following:

    >
    > > a) Create a new DICOM Instance
    > > b) Add all the tags as per selected IOD to DICOM
    > > * *instance
    > > c) When Pixel Data tag is encountered then
    > > * *Pixel Data(7FE0,0010)= jpeg pixel data from
    > > * *jpeg file
    > > d)Finally save the resulting DICOM file.

    >
    > > I need following clarifications:

    >
    > > a) Should I use "Default DICOM Transfer Syntax"
    > > * *i.e 1.2.840.10008.1.2 or i should use "JPEG
    > > * *Lossy Transfer Syntax" i.e 1.2.840.10008.1.2.4.50
    > > * *(for 8-bit) and 1.2.840.10008.1.2.4.51 (for 12 bit),
    > > * *since I will be copying pixels data of jpeg file to
    > > * *"Pixel Data" element(7FE0,0010) of the resulting DICOM
    > > * *file??Since in actual i wont be encoding that jpeg
    > > * *pixel that as per jpeg transfer syntax though it is jpeg
    > > * *pixel data.

    >
    > > b). No doubt i will be encoding other data elements as per
    > > * * Part -5 but when copying jpeg pixel data from a jpeg
    > > * * file, to the "Pixel Data" element(7FE0,0010) of
    > > * * resulting DICOM file ,I guess I am not encapsulating
    > > * * it as per jpeg lossy transfer syntax defined by
    > > * * DICOM i.e Part-5 "Table A.4-1" ?? Please clarify!

    >
    > > c) After copying the jpeg pixel data from my jpeg file
    > > * *to "Pixel Data" element of resulting DICOM file ,
    > > * *then will that DICOM file be interpreted by DICOM
    > > * *viewers clearly i.e. image will be clearly viewable,
    > > * *without any loss or degrading of image quality ??

    >
    > > * *Since if i go for Jpeg Tranfer Syntax UID , though
    > > * *my pixel data will be jpeg but not encoded as per
    > > * *DICOM JPEG Transfer Syntax and if i go for DICOM
    > > * *Default Transfer Syntax , then in actual my pixel
    > > * *data will be jpeg but transfer syntax will imply
    > > * *it is Uncompressed.

    >
    > > Waiting for your reply.Thanks in advance

    >
    > > Navdeep

    >
    > I am waiting for reply from you techies! Thanks in advance......- Hide quoted text -
    >
    > - Show quoted text -


    Hi Navdeep

    > > a) Should I use "Default DICOM Transfer Syntax"
    > > i.e 1.2.840.10008.1.2 or i should use "JPEG
    > > Lossy Transfer Syntax" i.e 1.2.840.10008.1.2.4.50
    > > (for 8-bit) and 1.2.840.10008.1.2.4.51 (for 12 bit),
    > > since I will be copying pixels data of jpeg file to
    > > "Pixel Data" element(7FE0,0010) of the resulting DICOM
    > > file??Since in actual i wont be encoding that jpeg
    > > pixel that as per jpeg transfer syntax though it is jpeg
    > > pixel data.


    You shall be using Explicit VR little endian to encode header data
    since you have encapsulated transfer syntax. But do mention
    1.2.840.10008.1.2.4.50 in the transfer syntax tag. Read creation of
    multiframe image, since you have secondary capture IOD (scanned image
    I guess), create a MF image with frame number attribute as 1 (see part
    3 page 121). Take care of creating basicoffset table and proper
    delimiters that would contain the JPEG data. You can directly use the
    JPEG data that you have received after scanning.

    > > b). No doubt i will be encoding other data elements as per
    > > Part -5 but when copying jpeg pixel data from a jpeg
    > > file, to the "Pixel Data" element(7FE0,0010) of
    > > resulting DICOM file ,I guess I am not encapsulating
    > > it as per jpeg lossy transfer syntax defined by
    > > DICOM i.e Part-5 "Table A.4-1" ?? Please clarify!


    See my answer above, I am not sure what do you mean by saying you are
    not encapsulating JPEG.

    > > c) After copying the jpeg pixel data from my jpeg file
    > > to "Pixel Data" element of resulting DICOM file ,
    > > then will that DICOM file be interpreted by DICOM
    > > viewers clearly i.e. image will be clearly viewable,
    > > without any loss or degrading of image quality ??

    >
    > > Since if i go for Jpeg Tranfer Syntax UID , though
    > > my pixel data will be jpeg but not encoded as per
    > > DICOM JPEG Transfer Syntax and if i go for DICOM
    > > Default Transfer Syntax , then in actual my pixel
    > > data will be jpeg but transfer syntax will imply
    > > it is Uncompressed.


    Create the file as described above, it should work. It is not clear to
    me why you want to set Implicit VR little endian as the transfer
    syntax of your file, rather it should be JPEG lossy. Any compressed
    image header is encoded in Explicit VR little endian.

    I hope above answers help. If anyone has any other opinion please
    write down.

    Regards
    Bimalendu


  4. Re: Urgenr! JPEG or Default Transfer Syntax to Choose?

    On Feb 6, 12:20 pm, bimalen...@gmail.com wrote:
    > On Feb 6, 9:22 am, navdeepr...@gmail.com wrote:
    >
    >
    >
    > > On Feb 5, 2:39 pm, navdeepr...@gmail.com wrote:

    >
    > > > Hi all I am converting a jpeg image files to DICOM format
    > > > .I am getting images scanned from a jpeg scanner and s
    > > > having them in jpg format.The library I am using, for converting
    > > > jpeg to DICOM, does not encodes the actual pixel data though it can
    > > > encode other Data Elements.In brief I am doing following:

    >
    > > > a) Create a new DICOM Instance
    > > > b) Add all the tags as per selected IOD to DICOM
    > > > instance
    > > > c) When Pixel Data tag is encountered then
    > > > Pixel Data(7FE0,0010)= jpeg pixel data from
    > > > jpeg file
    > > > d)Finally save the resulting DICOM file.

    >
    > > > I need following clarifications:

    >
    > > > a) Should I use "Default DICOM Transfer Syntax"
    > > > i.e 1.2.840.10008.1.2 or i should use "JPEG
    > > > Lossy Transfer Syntax" i.e 1.2.840.10008.1.2.4.50
    > > > (for 8-bit) and 1.2.840.10008.1.2.4.51 (for 12 bit),
    > > > since I will be copying pixels data of jpeg file to
    > > > "Pixel Data" element(7FE0,0010) of the resulting DICOM
    > > > file??Since in actual i wont be encoding that jpeg
    > > > pixel that as per jpeg transfer syntax though it is jpeg
    > > > pixel data.

    >
    > > > b). No doubt i will be encoding other data elements as per
    > > > Part -5 but when copying jpeg pixel data from a jpeg
    > > > file, to the "Pixel Data" element(7FE0,0010) of
    > > > resulting DICOM file ,I guess I am not encapsulating
    > > > it as per jpeg lossy transfer syntax defined by
    > > > DICOM i.e Part-5 "Table A.4-1" ?? Please clarify!

    >
    > > > c) After copying the jpeg pixel data from my jpeg file
    > > > to "Pixel Data" element of resulting DICOM file ,
    > > > then will that DICOM file be interpreted by DICOM
    > > > viewers clearly i.e. image will be clearly viewable,
    > > > without any loss or degrading of image quality ??

    >
    > > > Since if i go for Jpeg Tranfer Syntax UID , though
    > > > my pixel data will be jpeg but not encoded as per
    > > > DICOM JPEG Transfer Syntax and if i go for DICOM
    > > > Default Transfer Syntax , then in actual my pixel
    > > > data will be jpeg but transfer syntax will imply
    > > > it is Uncompressed.

    >
    > > > Waiting for your reply.Thanks in advance

    >
    > > > Navdeep

    >
    > > I am waiting for reply from you techies! Thanks in advance......- Hide quoted text -

    >
    > > - Show quoted text -

    >
    > Hi Navdeep
    >
    > > > a) Should I use "Default DICOM Transfer Syntax"
    > > > i.e 1.2.840.10008.1.2 or i should use "JPEG
    > > > Lossy Transfer Syntax" i.e 1.2.840.10008.1.2.4.50
    > > > (for 8-bit) and 1.2.840.10008.1.2.4.51 (for 12 bit),
    > > > since I will be copying pixels data of jpeg file to
    > > > "Pixel Data" element(7FE0,0010) of the resulting DICOM
    > > > file??Since in actual i wont be encoding that jpeg
    > > > pixel that as per jpeg transfer syntax though it is jpeg
    > > > pixel data.

    >
    > You shall be using Explicit VR little endian to encode header data
    > since you have encapsulated transfer syntax. But do mention
    > 1.2.840.10008.1.2.4.50 in the transfer syntax tag. Read creation of
    > multiframe image, since you have secondary capture IOD (scanned image
    > I guess), create a MF image with frame number attribute as 1 (see part
    > 3 page 121). Take care of creating basicoffset table and proper
    > delimiters that would contain the JPEG data. You can directly use the
    > JPEG data that you have received after scanning.
    >
    > > > b). No doubt i will be encoding other data elements as per
    > > > Part -5 but when copying jpeg pixel data from a jpeg
    > > > file, to the "Pixel Data" element(7FE0,0010) of
    > > > resulting DICOM file ,I guess I am not encapsulating
    > > > it as per jpeg lossy transfer syntax defined by
    > > > DICOM i.e Part-5 "Table A.4-1" ?? Please clarify!

    >
    > See my answer above, I am not sure what do you mean by saying you are
    > not encapsulating JPEG.
    >
    > > > c) After copying the jpeg pixel data from my jpeg file
    > > > to "Pixel Data" element of resulting DICOM file ,
    > > > then will that DICOM file be interpreted by DICOM
    > > > viewers clearly i.e. image will be clearly viewable,
    > > > without any loss or degrading of image quality ??

    >
    > > > Since if i go for Jpeg Tranfer Syntax UID , though
    > > > my pixel data will be jpeg but not encoded as per
    > > > DICOM JPEG Transfer Syntax and if i go for DICOM
    > > > Default Transfer Syntax , then in actual my pixel
    > > > data will be jpeg but transfer syntax will imply
    > > > it is Uncompressed.

    >
    > Create the file as described above, it should work. It is not clear to
    > me why you want to set Implicit VR little endian as the transfer
    > syntax of your file, rather it should be JPEG lossy. Any compressed
    > image header is encoded in Explicit VR little endian.
    >
    > I hope above answers help. If anyone has any other opinion please
    > write down.
    >
    > Regards
    > Bimalendu


    Hi Bimalendu, thanks for your reply!

    First of all I am using SC IOD and not the multiframe version of SC
    IOD. Secondly as you said:

    " Take care of creating basic offset table and proper
    delimiters that would contain the JPEG data"

    Please clarify :
    a) I guess by delimiters you meant the "Item Delimitation"(FFFE,E00D)
    and "Sequence Delimitation Item"(FFFE,E0DD). In my case none
    of DataElement has VR of "SQ" but the format of Explicit VR says
    if value length is of "undefined length" then value should be
    delimited
    by "Sequence Delimitation Item" , DICOM Part-5, Table 7.1-1. I am
    totally confused about this "Sequence Delimitation" and "Item
    Delimitation"
    where do i need it and what is difference between them and how to
    use
    it. Though i referred Part-5 for it but still I could not
    understand much? Please Clarify

    b)Secondly since i will be dealing with just single frame images so I
    guess
    "BasicOffsetTable" is not needed in my case? Please clarify!

    Once again thanks a lot for clarifying my doubts!

    Navdeep

  5. Re: Urgenr! JPEG or Default Transfer Syntax to Choose?

    On Feb 7, 5:32 pm, navdeepr...@gmail.com wrote:
    > On Feb 6, 12:20 pm, bimalen...@gmail.com wrote:
    >
    >
    >
    > > On Feb 6, 9:22 am, navdeepr...@gmail.com wrote:

    >
    > > > On Feb 5, 2:39 pm, navdeepr...@gmail.com wrote:

    >
    > > > > Hi all I am converting a jpeg image files to DICOM format
    > > > > .I am getting images scanned from a jpeg scanner and s
    > > > > having them in jpg format.The library I am using, for converting
    > > > > jpeg to DICOM, does not encodes the actual pixel data though it can
    > > > > encode other Data Elements.In brief I am doing following:

    >
    > > > > a) Create a new DICOM Instance
    > > > > b) Add all the tags as per selected IOD to DICOM
    > > > > instance
    > > > > c) When Pixel Data tag is encountered then
    > > > > Pixel Data(7FE0,0010)= jpeg pixel data from
    > > > > jpeg file
    > > > > d)Finally save the resulting DICOM file.

    >
    > > > > I need following clarifications:

    >
    > > > > a) Should I use "Default DICOM Transfer Syntax"
    > > > > i.e 1.2.840.10008.1.2 or i should use "JPEG
    > > > > Lossy Transfer Syntax" i.e 1.2.840.10008.1.2.4.50
    > > > > (for 8-bit) and 1.2.840.10008.1.2.4.51 (for 12 bit),
    > > > > since I will be copying pixels data of jpeg file to
    > > > > "Pixel Data" element(7FE0,0010) of the resulting DICOM
    > > > > file??Since in actual i wont be encoding that jpeg
    > > > > pixel that as per jpeg transfer syntax though it is jpeg
    > > > > pixel data.

    >
    > > > > b). No doubt i will be encoding other data elements as per
    > > > > Part -5 but when copying jpeg pixel data from a jpeg
    > > > > file, to the "Pixel Data" element(7FE0,0010) of
    > > > > resulting DICOM file ,I guess I am not encapsulating
    > > > > it as per jpeg lossy transfer syntax defined by
    > > > > DICOM i.e Part-5 "Table A.4-1" ?? Please clarify!

    >
    > > > > c) After copying the jpeg pixel data from my jpeg file
    > > > > to "Pixel Data" element of resulting DICOM file ,
    > > > > then will that DICOM file be interpreted by DICOM
    > > > > viewers clearly i.e. image will be clearly viewable,
    > > > > without any loss or degrading of image quality ??

    >
    > > > > Since if i go for Jpeg Tranfer Syntax UID , though
    > > > > my pixel data will be jpeg but not encoded as per
    > > > > DICOM JPEG Transfer Syntax and if i go for DICOM
    > > > > Default Transfer Syntax , then in actual my pixel
    > > > > data will be jpeg but transfer syntax will imply
    > > > > it is Uncompressed.

    >
    > > > > Waiting for your reply.Thanks in advance

    >
    > > > > Navdeep

    >
    > > > I am waiting for reply from you techies! Thanks in advance......- Hide quoted text -

    >
    > > > - Show quoted text -

    >
    > > Hi Navdeep

    >
    > > > > a) Should I use "Default DICOM Transfer Syntax"
    > > > > i.e 1.2.840.10008.1.2 or i should use "JPEG
    > > > > Lossy Transfer Syntax" i.e 1.2.840.10008.1.2.4.50
    > > > > (for 8-bit) and 1.2.840.10008.1.2.4.51 (for 12 bit),
    > > > > since I will be copying pixels data of jpeg file to
    > > > > "Pixel Data" element(7FE0,0010) of the resulting DICOM
    > > > > file??Since in actual i wont be encoding that jpeg
    > > > > pixel that as per jpeg transfer syntax though it is jpeg
    > > > > pixel data.

    >
    > > You shall be using Explicit VR little endian to encode header data
    > > since you have encapsulated transfer syntax. But do mention
    > > 1.2.840.10008.1.2.4.50 in the transfer syntax tag. Read creation of
    > > multiframe image, since you have secondary capture IOD (scanned image
    > > I guess), create a MF image with frame number attribute as 1 (see part
    > > 3 page 121). Take care of creating basicoffset table and proper
    > > delimiters that would contain the JPEG data. You can directly use the
    > > JPEG data that you have received after scanning.

    >
    > > > > b). No doubt i will be encoding other data elements as per
    > > > > Part -5 but when copying jpeg pixel data from a jpeg
    > > > > file, to the "Pixel Data" element(7FE0,0010) of
    > > > > resulting DICOM file ,I guess I am not encapsulating
    > > > > it as per jpeg lossy transfer syntax defined by
    > > > > DICOM i.e Part-5 "Table A.4-1" ?? Please clarify!

    >
    > > See my answer above, I am not sure what do you mean by saying you are
    > > not encapsulating JPEG.

    >
    > > > > c) After copying the jpeg pixel data from my jpeg file
    > > > > to "Pixel Data" element of resulting DICOM file ,
    > > > > then will that DICOM file be interpreted by DICOM
    > > > > viewers clearly i.e. image will be clearly viewable,
    > > > > without any loss or degrading of image quality ??

    >
    > > > > Since if i go for Jpeg Tranfer Syntax UID , though
    > > > > my pixel data will be jpeg but not encoded as per
    > > > > DICOM JPEG Transfer Syntax and if i go for DICOM
    > > > > Default Transfer Syntax , then in actual my pixel
    > > > > data will be jpeg but transfer syntax will imply
    > > > > it is Uncompressed.

    >
    > > Create the file as described above, it should work. It is not clear to
    > > me why you want to set Implicit VR little endian as the transfer
    > > syntax of your file, rather it should be JPEG lossy. Any compressed
    > > image header is encoded in Explicit VR little endian.

    >
    > > I hope above answers help. If anyone has any other opinion please
    > > write down.

    >
    > > Regards
    > > Bimalendu

    >
    > Hi Bimalendu, thanks for your reply!
    >
    > First of all I am using SC IOD and not the multiframe version of SC
    > IOD. Secondly as you said:
    >
    > " Take care of creating basic offset table and proper
    > delimiters that would contain the JPEG data"
    >
    > Please clarify :
    > a) I guess by delimiters you meant the "Item Delimitation"(FFFE,E00D)
    > and "Sequence Delimitation Item"(FFFE,E0DD). In my case none
    > of DataElement has VR of "SQ" but the format of Explicit VR says
    > if value length is of "undefined length" then value should be
    > delimited
    > by "Sequence Delimitation Item" , DICOM Part-5, Table 7.1-1. I am
    > totally confused about this "Sequence Delimitation" and "Item
    > Delimitation"
    > where do i need it and what is difference between them and how to
    > use
    > it. Though i referred Part-5 for it but still I could not
    > understand much? Please Clarify
    >
    > b)Secondly since i will be dealing with just single frame images so I
    > guess
    > "BasicOffsetTable" is not needed in my case? Please clarify!
    >
    > Once again thanks a lot for clarifying my doubts!
    >
    > Navdeep


    Hi Navdeep

    See my answers

    > First of all I am using SC IOD and not the multiframe version of SC
    > IOD. Secondly as you said:
    >
    > " Take care of creating basic offset table and proper
    > delimiters that would contain the JPEG data"


    I have already mentioned page 121 part 3 latest 2008 base standard.
    Go through the page.
    It mentions:

    "The use of SC Image Information Objection Definition is deprecated,
    and other more specific SC Image IODs should be used."
    The following IODs are all multi-frame. A single frame image is
    encoded as a multi-frame image with only one frame. The multi-frame SC
    IODs consist of:
    - Multi-frame Single Bit Secondary Capture Image IOD
    - Multi-frame Grayscale Byte Secondary Capture Image IOD
    - Multi-frame Grayscale Word Secondary Capture Image IOD
    - Multi-frame True Color Secondary Capture Image IOD

    a) I guess by delimiters you meant the "Item Delimitation"(FFFE,E00D)
    > and "Sequence Delimitation Item"(FFFE,E0DD). In my case none
    > of DataElement has VR of "SQ" but the format of Explicit VR says
    > if value length is of "undefined length" then value should be
    > delimited
    > by "Sequence Delimitation Item" , DICOM Part-5, Table 7.1-1. I am
    > totally confused about this "Sequence Delimitation" and "Item
    > Delimitation"
    > where do i need it and what is difference between them and how to
    > use
    > it. Though i referred Part-5 for it but still I could not
    > understand much? Please Clarify


    Have a look at page 66 part 5 latest 2008 standard to know how
    multiframe image looks like and what do I mean by basic offset table,
    item and sequence delimiters. Go through encoding of encapsulated
    pixel data details in the same document.

    b)Secondly since i will be dealing with just single frame images so I
    > guess
    > "BasicOffsetTable" is not needed in my case? Please clarify!


    Does not matter whether you have one frame or more than one, if you
    have multiframe image then basic offset table is mandatory, but of
    course to escape you can keep it empty.

    I hope it will help you.

    Regards
    Bimalendu

  6. Re: Urgenr! JPEG or Default Transfer Syntax to Choose?

    On Feb 11, 4:23 pm, bimalen...@gmail.com wrote:
    > On Feb 7, 5:32 pm, navdeepr...@gmail.com wrote:
    >
    >
    >
    > > On Feb 6, 12:20 pm, bimalen...@gmail.com wrote:

    >
    > > > On Feb 6, 9:22 am, navdeepr...@gmail.com wrote:

    >
    > > > > On Feb 5, 2:39 pm, navdeepr...@gmail.com wrote:

    >
    > > > > > Hi all I am converting a jpeg image files to DICOM format
    > > > > > .I am getting images scanned from a jpeg scanner and s
    > > > > > having them in jpg format.The library I am using, for converting
    > > > > > jpeg to DICOM, does not encodes the actual pixel data though it can
    > > > > > encode other Data Elements.In brief I am doing following:

    >
    > > > > > a) Create a new DICOM Instance
    > > > > > b) Add all the tags as per selected IOD to DICOM
    > > > > > instance
    > > > > > c) When Pixel Data tag is encountered then
    > > > > > Pixel Data(7FE0,0010)= jpeg pixel data from
    > > > > > jpeg file
    > > > > > d)Finally save the resulting DICOM file.

    >
    > > > > > I need following clarifications:

    >
    > > > > > a) Should I use "Default DICOM Transfer Syntax"
    > > > > > i.e 1.2.840.10008.1.2 or i should use "JPEG
    > > > > > Lossy Transfer Syntax" i.e 1.2.840.10008.1.2.4.50
    > > > > > (for 8-bit) and 1.2.840.10008.1.2.4.51 (for 12 bit),
    > > > > > since I will be copying pixels data of jpeg file to
    > > > > > "Pixel Data" element(7FE0,0010) of the resulting DICOM
    > > > > > file??Since in actual i wont be encoding that jpeg
    > > > > > pixel that as per jpeg transfer syntax though it is jpeg
    > > > > > pixel data.

    >
    > > > > > b). No doubt i will be encoding other data elements as per
    > > > > > Part -5 but when copying jpeg pixel data from a jpeg
    > > > > > file, to the "Pixel Data" element(7FE0,0010) of
    > > > > > resulting DICOM file ,I guess I am not encapsulating
    > > > > > it as per jpeg lossy transfer syntax defined by
    > > > > > DICOM i.e Part-5 "Table A.4-1" ?? Please clarify!

    >
    > > > > > c) After copying the jpeg pixel data from my jpeg file
    > > > > > to "Pixel Data" element of resulting DICOM file ,
    > > > > > then will that DICOM file be interpreted by DICOM
    > > > > > viewers clearly i.e. image will be clearly viewable,
    > > > > > without any loss or degrading of image quality ??

    >
    > > > > > Since if i go for Jpeg Tranfer Syntax UID , though
    > > > > > my pixel data will be jpeg but not encoded as per
    > > > > > DICOM JPEG Transfer Syntax and if i go for DICOM
    > > > > > Default Transfer Syntax , then in actual my pixel
    > > > > > data will be jpeg but transfer syntax will imply
    > > > > > it is Uncompressed.

    >
    > > > > > Waiting for your reply.Thanks in advance

    >
    > > > > > Navdeep

    >
    > > > > I am waiting for reply from you techies! Thanks in advance......- Hide quoted text -

    >
    > > > > - Show quoted text -

    >
    > > > Hi Navdeep

    >
    > > > > > a) Should I use "Default DICOM Transfer Syntax"
    > > > > > i.e 1.2.840.10008.1.2 or i should use "JPEG
    > > > > > Lossy Transfer Syntax" i.e 1.2.840.10008.1.2.4.50
    > > > > > (for 8-bit) and 1.2.840.10008.1.2.4.51 (for 12 bit),
    > > > > > since I will be copying pixels data of jpeg file to
    > > > > > "Pixel Data" element(7FE0,0010) of the resulting DICOM
    > > > > > file??Since in actual i wont be encoding that jpeg
    > > > > > pixel that as per jpeg transfer syntax though it is jpeg
    > > > > > pixel data.

    >
    > > > You shall be using Explicit VR little endian to encode header data
    > > > since you have encapsulated transfer syntax. But do mention
    > > > 1.2.840.10008.1.2.4.50 in the transfer syntax tag. Read creation of
    > > > multiframe image, since you have secondary capture IOD (scanned image
    > > > I guess), create a MF image with frame number attribute as 1 (see part
    > > > 3 page 121). Take care of creating basicoffset table and proper
    > > > delimiters that would contain the JPEG data. You can directly use the
    > > > JPEG data that you have received after scanning.

    >
    > > > > > b). No doubt i will be encoding other data elements as per
    > > > > > Part -5 but when copying jpeg pixel data from a jpeg
    > > > > > file, to the "Pixel Data" element(7FE0,0010) of
    > > > > > resulting DICOM file ,I guess I am not encapsulating
    > > > > > it as per jpeg lossy transfer syntax defined by
    > > > > > DICOM i.e Part-5 "Table A.4-1" ?? Please clarify!

    >
    > > > See my answer above, I am not sure what do you mean by saying you are
    > > > not encapsulating JPEG.

    >
    > > > > > c) After copying the jpeg pixel data from my jpeg file
    > > > > > to "Pixel Data" element of resulting DICOM file ,
    > > > > > then will that DICOM file be interpreted by DICOM
    > > > > > viewers clearly i.e. image will be clearly viewable,
    > > > > > without any loss or degrading of image quality ??

    >
    > > > > > Since if i go for Jpeg Tranfer Syntax UID , though
    > > > > > my pixel data will be jpeg but not encoded as per
    > > > > > DICOM JPEG Transfer Syntax and if i go for DICOM
    > > > > > Default Transfer Syntax , then in actual my pixel
    > > > > > data will be jpeg but transfer syntax will imply
    > > > > > it is Uncompressed.

    >
    > > > Create the file as described above, it should work. It is not clear to
    > > > me why you want to set Implicit VR little endian as the transfer
    > > > syntax of your file, rather it should be JPEG lossy. Any compressed
    > > > image header is encoded in Explicit VR little endian.

    >
    > > > I hope above answers help. If anyone has any other opinion please
    > > > write down.

    >
    > > > Regards
    > > > Bimalendu

    >
    > > Hi Bimalendu, thanks for your reply!

    >
    > > First of all I am using SC IOD and not the multiframe version of SC
    > > IOD. Secondly as you said:

    >
    > > " Take care of creating basic offset table and proper
    > > delimiters that would contain the JPEG data"

    >
    > > Please clarify :
    > > a) I guess by delimiters you meant the "Item Delimitation"(FFFE,E00D)
    > > and "Sequence Delimitation Item"(FFFE,E0DD). In my case none
    > > of DataElement has VR of "SQ" but the format of Explicit VR says
    > > if value length is of "undefined length" then value should be
    > > delimited
    > > by "Sequence Delimitation Item" , DICOM Part-5, Table 7.1-1. I am
    > > totally confused about this "Sequence Delimitation" and "Item
    > > Delimitation"
    > > where do i need it and what is difference between them and how to
    > > use
    > > it. Though i referred Part-5 for it but still I could not
    > > understand much? Please Clarify

    >
    > > b)Secondly since i will be dealing with just single frame images so I
    > > guess
    > > "BasicOffsetTable" is not needed in my case? Please clarify!

    >
    > > Once again thanks a lot for clarifying my doubts!

    >
    > > Navdeep

    >
    > Hi Navdeep
    >
    > See my answers
    >
    > > First of all I am using SC IOD and not the multiframe version of SC
    > > IOD. Secondly as you said:

    >
    > > " Take care of creating basic offset table and proper
    > > delimiters that would contain the JPEG data"

    >
    > I have already mentioned page 121 part 3 latest 2008 base standard.
    > Go through the page.
    > It mentions:
    >
    > "The use of SC Image Information Objection Definition is deprecated,
    > and other more specific SC Image IODs should be used."
    > The following IODs are all multi-frame. A single frame image is
    > encoded as a multi-frame image with only one frame. The multi-frame SC
    > IODs consist of:
    > - Multi-frame Single Bit Secondary Capture Image IOD
    > - Multi-frame Grayscale Byte Secondary Capture Image IOD
    > - Multi-frame Grayscale Word Secondary Capture Image IOD
    > - Multi-frame True Color Secondary Capture Image IOD
    >
    > a) I guess by delimiters you meant the "Item Delimitation"(FFFE,E00D)
    >
    > > and "Sequence Delimitation Item"(FFFE,E0DD). In my case none
    > > of DataElement has VR of "SQ" but the format of Explicit VR says
    > > if value length is of "undefined length" then value should be
    > > delimited
    > > by "Sequence Delimitation Item" , DICOM Part-5, Table 7.1-1. I am
    > > totally confused about this "Sequence Delimitation" and "Item
    > > Delimitation"
    > > where do i need it and what is difference between them and how to
    > > use
    > > it. Though i referred Part-5 for it but still I could not
    > > understand much? Please Clarify

    >
    > Have a look at page 66 part 5 latest 2008 standard to know how
    > multiframe image looks like and what do I mean by basic offset table,
    > item and sequence delimiters. Go through encoding of encapsulated
    > pixel data details in the same document.
    >
    > b)Secondly since i will be dealing with just single frame images so I
    >
    > > guess
    > > "BasicOffsetTable" is not needed in my case? Please clarify!

    >
    > Does not matter whether you have one frame or more than one, if you
    > have multiframe image then basic offset table is mandatory, but of
    > course to escape you can keep it empty.
    >
    > I hope it will help you.
    >
    > Regards
    > Bimalendu


    Thanks a lot.
    cheersss.sssssss
    Navdeep

+ Reply to Thread