-
-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Rewrite] Native Pixel Data Parsing, handle value multiplicity. (#86)
This implements native pixel data parsing on the rewrite branch. This includes fixes done on the mainline branch to parse PixelData properly if it appears multiple times in a DICOM (PR #79). This also includes some fixes to better handle value multiplicity.
- Loading branch information
1 parent
1cfebc8
commit 441d2c4
Showing
7 changed files
with
264 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,24 @@ | ||
package dicom | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/suyashkumar/dicom/pkg/tag" | ||
) | ||
|
||
var ErrorElementNotFound = errors.New("element not found") | ||
|
||
type Dataset struct { | ||
Elements []*Element | ||
Size uint64 | ||
} | ||
|
||
// FindElementByTag searches through the dataset and returns a pointer to the matching element. | ||
// It DOES NOT search within Sequences as well. | ||
func (d *Dataset) FindElementByTag(tag tag.Tag) (*Element, error) { | ||
for _, e := range d.Elements { | ||
if e.Tag == tag { | ||
return e, nil | ||
} | ||
} | ||
return nil, ErrorElementNotFound | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.