Skip to content

Commit

Permalink
Scala formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
karl-exini committed Oct 12, 2020
1 parent ff7dfa8 commit 2bcec5c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/main/scala/com/exini/dicom/data/Elements.scala
Expand Up @@ -802,15 +802,17 @@ case class Elements(characterSets: CharacterSets, zoneOffset: ZoneOffset, data:
val s = strings.mkString(multiValueDelimiter)
val vm = strings.length.toString
s"$indent${tagToString(e.tag)} ${e.vr} [$s] ${space1(s)} # ${space2(e.length)} ${e.length}, $vm ${Lookup
.keywordOf(e.tag).getOrElse("")}" :: Nil
.keywordOf(e.tag)
.getOrElse("")}" :: Nil

case s: Sequence =>
val heading = {
val description =
if (s.length == indeterminateLength) "Sequence with indeterminate length"
else s"Sequence with explicit length ${s.length}"
s"$indent${tagToString(s.tag)} SQ ($description) ${space1(description)} # ${space2(s.length)} ${s.length}, 1 ${Lookup
.keywordOf(s.tag).getOrElse("")}"
.keywordOf(s.tag)
.getOrElse("")}"
}
val items = s.items.flatMap { i =>
val heading = {
Expand Down
5 changes: 4 additions & 1 deletion src/main/scala/com/exini/dicom/streams/ParseFlow.scala
Expand Up @@ -183,7 +183,10 @@ class ParseFlow private (chunkSize: Int) extends ByteStringParser[DicomPart] {
else {
reader.ensure(valueLength.toInt + 2)
val firstTwoBytes = reader.remainingData.drop(valueLength.toInt).take(2)
if (!state.tsuid.contains(UID.DeflatedExplicitVRLittleEndian) && bytesToShort(firstTwoBytes, state.bigEndian) == 2) {
if (
!state.tsuid
.contains(UID.DeflatedExplicitVRLittleEndian) && bytesToShort(firstTwoBytes, state.bigEndian) == 2
) {
log.warning("Wrong File Meta Information Group Length (0002,0000)")
InFmiHeader(updatedState)
} else {
Expand Down
6 changes: 3 additions & 3 deletions src/test/scala/com/exini/dicom/streams/DicomFlowsTest.scala
Expand Up @@ -3,12 +3,12 @@ package com.exini.dicom.streams
import java.io.File

import akka.actor.ActorSystem
import akka.stream.scaladsl.{FileIO, Sink, Source}
import akka.stream.scaladsl.{ FileIO, Sink, Source }
import akka.stream.testkit.scaladsl.TestSink
import akka.testkit.TestKit
import akka.util.ByteString
import com.exini.dicom.data.DicomElements.ValueElement
import com.exini.dicom.data.DicomParts.{DicomPart, MetaPart}
import com.exini.dicom.data.DicomParts.{ DicomPart, MetaPart }
import com.exini.dicom.data.TestData._
import com.exini.dicom.data._
import com.exini.dicom.streams.DicomFlows._
Expand All @@ -20,7 +20,7 @@ import org.scalatest.flatspec.AnyFlatSpecLike
import org.scalatest.matchers.should.Matchers

import scala.concurrent.duration.DurationInt
import scala.concurrent.{Await, ExecutionContextExecutor}
import scala.concurrent.{ Await, ExecutionContextExecutor }

class DicomFlowsTest
extends TestKit(ActorSystem("DicomFlowsSpec"))
Expand Down

0 comments on commit 2bcec5c

Please sign in to comment.