Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Pause for storage relocation.


devel / comp.protocols.dicom / Sanity Check on Multi-Frame with Zero-Length Basic Offset Table

SubjectAuthor
* Sanity Check on Multi-Frame with Zero-Length Basic Offset TableDavid Vaccaro
`* Re: Sanity Check on Multi-Frame with Zero-Length Basic Offset TableDavid Clunie
 `- Re: Sanity Check on Multi-Frame with Zero-Length Basic Offset TableDavid Vaccaro

1
Sanity Check on Multi-Frame with Zero-Length Basic Offset Table

<1e5e5c3c-b43b-4eaf-b2ac-440f718342f9n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=645&group=comp.protocols.dicom#645

  copy link   Newsgroups: comp.protocols.dicom
X-Received: by 2002:a05:620a:191c:b0:748:4a62:2ba3 with SMTP id bj28-20020a05620a191c00b007484a622ba3mr1289577qkb.8.1680713950243;
Wed, 05 Apr 2023 09:59:10 -0700 (PDT)
X-Received: by 2002:a05:620a:1912:b0:742:9e15:3e0 with SMTP id
bj18-20020a05620a191200b007429e1503e0mr1486365qkb.5.1680713950090; Wed, 05
Apr 2023 09:59:10 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.protocols.dicom
Date: Wed, 5 Apr 2023 09:59:09 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=2603:3005:2b2c:c000:956b:7ce4:cdaa:3159;
posting-account=LXGlXQkAAAAXcnIC3TK2J1f2RQtrsH_b
NNTP-Posting-Host: 2603:3005:2b2c:c000:956b:7ce4:cdaa:3159
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1e5e5c3c-b43b-4eaf-b2ac-440f718342f9n@googlegroups.com>
Subject: Sanity Check on Multi-Frame with Zero-Length Basic Offset Table
From: dvaccaro@xinonix.com (David Vaccaro)
Injection-Date: Wed, 05 Apr 2023 16:59:10 +0000
Content-Type: text/plain; charset="UTF-8"
 by: David Vaccaro - Wed, 5 Apr 2023 16:59 UTC

Hello All,

I have read all the group discussions going back to 1998 with regards to zero-length Basic Offset Tables and I am still confused about one particular case.

Here is the condition:
1. Multi-frame PixelData that has a valid zero-length Basic Offset table within the first fragment.
2. N-number of additional well formed fragments.
3. The DICOM standard rule that essentially states that a frame can span fragments BUT only one frames data can be present in a given fragment.

The questions:
1. Is this condition valid?
2. If so, how does one determine the start and end of each frames data?

I would be easy if there was an additional rule that stated that under this condition, each frame SHALL occupy only one a single fragment but I'm almost certain that this is NOT what the standard states.

Thanks for any answers!

Dave

Re: Sanity Check on Multi-Frame with Zero-Length Basic Offset Table

<e0f0960e-d55e-4453-b217-1e52ed44b5e3n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=646&group=comp.protocols.dicom#646

  copy link   Newsgroups: comp.protocols.dicom
X-Received: by 2002:a05:6214:ab4:b0:5d1:18cd:31df with SMTP id ew20-20020a0562140ab400b005d118cd31dfmr313466qvb.5.1680752347394;
Wed, 05 Apr 2023 20:39:07 -0700 (PDT)
X-Received: by 2002:ac8:5cc8:0:b0:3e6:4595:ecf9 with SMTP id
s8-20020ac85cc8000000b003e64595ecf9mr1993967qta.11.1680752347222; Wed, 05 Apr
2023 20:39:07 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.protocols.dicom
Date: Wed, 5 Apr 2023 20:39:06 -0700 (PDT)
In-Reply-To: <1e5e5c3c-b43b-4eaf-b2ac-440f718342f9n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=50.32.255.70; posting-account=rKkGZwkAAADOuxQ23uuHnmKt95j-5iL6
NNTP-Posting-Host: 50.32.255.70
References: <1e5e5c3c-b43b-4eaf-b2ac-440f718342f9n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <e0f0960e-d55e-4453-b217-1e52ed44b5e3n@googlegroups.com>
Subject: Re: Sanity Check on Multi-Frame with Zero-Length Basic Offset Table
From: dclunie@dclunie.com (David Clunie)
Injection-Date: Thu, 06 Apr 2023 03:39:07 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: David Clunie - Thu, 6 Apr 2023 03:39 UTC

This is a valid scenario for those transfer syntaxes that encode each frame independently (i.e., not MPEG family) - frames may be fragmented regardless of whether there is a BOT or not.

The short answer is that the recipient has to walk through the Pixel Data Items (using their fixed length) and build its own "offset table".

Obviously if the number of items after the (empty) BOT item is == the value of Number of Frames, then there is one frame per fragment, and the offsets to each fragment == the offsets to each frame.

If the number of items after the (empty) BOT item is > the value of Number of Frames, then one or more frames are fragmented, so one has to figure out which fragments belong to which frame, and doing that is transfer syntax dependent.

The general answer is to decode each frame using as many fragments as necessary to complete the frame, but that is a potentially expensive operation. For JPEG marker segment schemes (including baseline JPEG, lossless JPEG, JPEG-LS and J2K), one can cheat and walk back from the end of each fragment looking for EOI markers (allowing for permitted trailing padding), which may be faster.

David

On Wednesday, April 5, 2023 at 12:59:11 PM UTC-4, David Vaccaro wrote:
> Hello All,
>
> I have read all the group discussions going back to 1998 with regards to zero-length Basic Offset Tables and I am still confused about one particular case.
>
> Here is the condition:
> 1. Multi-frame PixelData that has a valid zero-length Basic Offset table within the first fragment.
> 2. N-number of additional well formed fragments.
> 3. The DICOM standard rule that essentially states that a frame can span fragments BUT only one frames data can be present in a given fragment.
>
> The questions:
> 1. Is this condition valid?
> 2. If so, how does one determine the start and end of each frames data?
>
> I would be easy if there was an additional rule that stated that under this condition, each frame SHALL occupy only one a single fragment but I'm almost certain that this is NOT what the standard states.
>
> Thanks for any answers!
>
> Dave

Re: Sanity Check on Multi-Frame with Zero-Length Basic Offset Table

<17f0293a-e449-4d5d-8bd8-8b4a612dd2b3n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=647&group=comp.protocols.dicom#647

  copy link   Newsgroups: comp.protocols.dicom
X-Received: by 2002:a05:620a:190b:b0:746:7be8:f89e with SMTP id bj11-20020a05620a190b00b007467be8f89emr2030326qkb.7.1680782173956;
Thu, 06 Apr 2023 04:56:13 -0700 (PDT)
X-Received: by 2002:a05:620a:468e:b0:748:88dc:da99 with SMTP id
bq14-20020a05620a468e00b0074888dcda99mr1953300qkb.0.1680782173709; Thu, 06
Apr 2023 04:56:13 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.protocols.dicom
Date: Thu, 6 Apr 2023 04:56:13 -0700 (PDT)
In-Reply-To: <e0f0960e-d55e-4453-b217-1e52ed44b5e3n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2603:3005:2b2c:c000:c954:a083:f28b:7da1;
posting-account=LXGlXQkAAAAXcnIC3TK2J1f2RQtrsH_b
NNTP-Posting-Host: 2603:3005:2b2c:c000:c954:a083:f28b:7da1
References: <1e5e5c3c-b43b-4eaf-b2ac-440f718342f9n@googlegroups.com> <e0f0960e-d55e-4453-b217-1e52ed44b5e3n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <17f0293a-e449-4d5d-8bd8-8b4a612dd2b3n@googlegroups.com>
Subject: Re: Sanity Check on Multi-Frame with Zero-Length Basic Offset Table
From: dvaccaro@xinonix.com (David Vaccaro)
Injection-Date: Thu, 06 Apr 2023 11:56:13 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: David Vaccaro - Thu, 6 Apr 2023 11:56 UTC

On Wednesday, April 5, 2023 at 11:39:09 PM UTC-4, David Clunie wrote:
> This is a valid scenario for those transfer syntaxes that encode each frame independently (i.e., not MPEG family) - frames may be fragmented regardless of whether there is a BOT or not.
>
> The short answer is that the recipient has to walk through the Pixel Data Items (using their fixed length) and build its own "offset table".
>
> Obviously if the number of items after the (empty) BOT item is == the value of Number of Frames, then there is one frame per fragment, and the offsets to each fragment == the offsets to each frame.
>
> If the number of items after the (empty) BOT item is > the value of Number of Frames, then one or more frames are fragmented, so one has to figure out which fragments belong to which frame, and doing that is transfer syntax dependent.
>
> The general answer is to decode each frame using as many fragments as necessary to complete the frame, but that is a potentially expensive operation.. For JPEG marker segment schemes (including baseline JPEG, lossless JPEG, JPEG-LS and J2K), one can cheat and walk back from the end of each fragment looking for EOI markers (allowing for permitted trailing padding), which may be faster.
>
> David
> On Wednesday, April 5, 2023 at 12:59:11 PM UTC-4, David Vaccaro wrote:
> > Hello All,
> >
> > I have read all the group discussions going back to 1998 with regards to zero-length Basic Offset Tables and I am still confused about one particular case.
> >
> > Here is the condition:
> > 1. Multi-frame PixelData that has a valid zero-length Basic Offset table within the first fragment.
> > 2. N-number of additional well formed fragments.
> > 3. The DICOM standard rule that essentially states that a frame can span fragments BUT only one frames data can be present in a given fragment.
> >
> > The questions:
> > 1. Is this condition valid?
> > 2. If so, how does one determine the start and end of each frames data?
> >
> > I would be easy if there was an additional rule that stated that under this condition, each frame SHALL occupy only one a single fragment but I'm almost certain that this is NOT what the standard states.
> >
> > Thanks for any answers!
> >
> > Dave

Great.. Thanks for the info, David. This makes perfect sense.

The below is stated for the benefit of others who might find themselves in the same pickle:

I was getting stuck wanting to completely be able to establish the list of offsets by ONLY using the overall length of the PixelData and the list of parsed segments (Item Tag/Item Length/Seq Del Tag) and not considering the Number of Frames value or the particular image encoding or anything else for that matter.

The rule for parsing the PixelData stream segments is universal and simple as is the rule for parsing and utilizing a non-zero length Basic Offset Table (with a simple set of 4-byte offsets into the stream).

BUT when the Basic Offset Table is zero-length, then the "Number of Frames" tag value is essential to determining IF each frame is occupying its own segment (simple happy path) OR if one or more frames actually occupy more than one segment. (valid but a bit more work)

FURTHER, when parsing a given frame (from one or more segments), the final segment containing the end of that frame data may be determined by either (1) using the cheat of looking back from the end of each segment for an EOI marker (if the encoding format utilizes one) OR (2) just feeding the segments of data to the decoder until it indicates that the frame is complete.

Dave

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor