<commit_before>package main

import (
	"flag"
	"fmt"
	"github.com/gillesdemey/go-dicom"
	"io/ioutil"
)

var (
	file = flag.String("file", "IM-0001-0001.dcm", "the DICOM file you want to parse")
)

func init() {
	flag.Parse()
}

func main() {

	parser, err := dicom.NewParser()
	if err != nil {
		panic(err)
	}

	bytes, err := ioutil.ReadFile(*file)

	if err != nil {
		panic(err)
	}

	data, err := parser.Parse(bytes)

	if err != nil {
		fmt.Println(err)
	}

	elem, _ := data.LookupElement("PatientName")
	name := elem.Value
	fmt.Printf("Patient name: %s\n", name)

}<commit_msg>CLI will output all dataelements<commit_after>package main

import (
	"flag"
	"fmt"
	"github.com/gillesdemey/go-dicom"
	"io/ioutil"
)

var (
	file = flag.String("file", "IM-0001-0001.dcm", "the DICOM file you want to parse")
)

func init() {
	flag.Parse()
}

func main() {

	parser, err := dicom.NewParser()
	if err != nil {
		panic(err)
	}

	bytes, err := ioutil.ReadFile(*file)

	if err != nil {
		panic(err)
	}

	data, err := parser.Parse(bytes)

	if err != nil {
		fmt.Println(err)
	}

	for _, elem := range data.Elements {
		fmt.Printf("%+v\n", elem)
	}

}
{'fraction_non_alphanumeric': 0.1780701754385965, 'fraction_numerical': 0.014035087719298246, 'mean_word_length': 3.3884615384615384, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7503577', 'n_tokens_mistral': 510, 'n_tokens_neox': 477, 'n_words': 106}