@@ -891,7 +891,7 @@ class DatasetLayerDAO @Inject()(
891
891
category <- Category .fromString(row.category).toFox ?~> " Could not parse Layer Category"
892
892
boundingBox <- BoundingBox
893
893
.fromSQL(parseArrayLiteral(row.boundingbox).map(_.toInt))
894
- .toFox ?~> " Could not parse boundingbox "
894
+ .toFox ?~> " Could not parse bounding box "
895
895
elementClass <- ElementClass .fromString(row.elementclass).toFox ?~> " Could not parse Layer ElementClass"
896
896
mags <- datasetMagsDAO.findMagForLayer(datasetId, row.name) ?~> " Could not find mag for layer"
897
897
defaultViewConfigurationOpt <- Fox .runOptional(row.defaultviewconfiguration)(
@@ -955,166 +955,7 @@ class DatasetLayerDAO @Inject()(
955
955
rowsParsed <- Fox .combined(rows.toList.map(parseRow(_, datasetId)))
956
956
} yield rowsParsed
957
957
958
- def findAllForDatasetWithMags (datasetId : ObjectId ): Fox [List [DataLayer ]] =
959
- for {
960
- layers <- findAllForDataset(datasetId)
961
- layerNamesAndMags <- datasetMagsDAO.findAllByDatasetId(datasetId)
962
- layersWithMags = layers.map { layer =>
963
- val mags = layerNamesAndMags.filter(_._1 == layer.name).map(_._2).toList
964
- layer match {
965
- // Maybe move this somewhere else?
966
- case AbstractDataLayer (name,
967
- category,
968
- boundingBox,
969
- resolutions,
970
- elementClass,
971
- defaultViewConfiguration,
972
- adminViewConfiguration,
973
- coordinateTransformations,
974
- additionalAxes,
975
- _,
976
- numChannels,
977
- dataFormat,
978
- _) =>
979
- dataFormat match {
980
- case Some (df) =>
981
- df match {
982
- case DataFormat .wkw =>
983
- throw new NotImplementedError (
984
- " WKW data format not supported in this context, only datasets with MagLocators are supported" )
985
- case DataFormat .neuroglancerPrecomputed =>
986
- PrecomputedDataLayer (name,
987
- boundingBox,
988
- category,
989
- elementClass,
990
- mags,
991
- defaultViewConfiguration,
992
- adminViewConfiguration,
993
- coordinateTransformations,
994
- numChannels,
995
- additionalAxes)
996
- case DataFormat .n5 =>
997
- N5DataLayer (name,
998
- category,
999
- boundingBox,
1000
- elementClass,
1001
- mags,
1002
- defaultViewConfiguration,
1003
- adminViewConfiguration,
1004
- coordinateTransformations,
1005
- numChannels,
1006
- additionalAxes)
1007
- case DataFormat .zarr =>
1008
- ZarrDataLayer (name,
1009
- category,
1010
- boundingBox,
1011
- elementClass,
1012
- mags,
1013
- defaultViewConfiguration,
1014
- adminViewConfiguration,
1015
- coordinateTransformations,
1016
- numChannels,
1017
- additionalAxes,
1018
- df)
1019
- case DataFormat .zarr3 =>
1020
- Zarr3DataLayer (name,
1021
- category,
1022
- boundingBox,
1023
- elementClass,
1024
- mags,
1025
- defaultViewConfiguration,
1026
- adminViewConfiguration,
1027
- coordinateTransformations,
1028
- numChannels,
1029
- additionalAxes)
1030
- }
1031
- case None => ???
1032
- }
1033
- case AbstractSegmentationLayer (name,
1034
- category,
1035
- boundingBox,
1036
- resolutions,
1037
- elementClass,
1038
- largestSegmentId,
1039
- mappings,
1040
- defaultViewConfiguration,
1041
- adminViewConfiguration,
1042
- coordinateTransformations,
1043
- additionalAxes,
1044
- _,
1045
- numChannels,
1046
- dataFormat,
1047
- _) =>
1048
- dataFormat match {
1049
- case Some (df) =>
1050
- df match {
1051
- case DataFormat .wkw =>
1052
- throw new NotImplementedError (
1053
- " WKW data format not supported in this context, only datasets with MagLocators are supported" )
1054
- case DataFormat .neuroglancerPrecomputed =>
1055
- PrecomputedSegmentationLayer (
1056
- name,
1057
- boundingBox,
1058
- elementClass,
1059
- mags,
1060
- largestSegmentId,
1061
- mappings,
1062
- defaultViewConfiguration,
1063
- adminViewConfiguration,
1064
- coordinateTransformations,
1065
- numChannels,
1066
- additionalAxes,
1067
- )
1068
- case DataFormat .n5 =>
1069
- N5SegmentationLayer (
1070
- name,
1071
- boundingBox,
1072
- elementClass,
1073
- mags,
1074
- largestSegmentId,
1075
- mappings,
1076
- defaultViewConfiguration,
1077
- adminViewConfiguration,
1078
- coordinateTransformations,
1079
- numChannels,
1080
- additionalAxes
1081
- )
1082
- case DataFormat .zarr =>
1083
- ZarrSegmentationLayer (
1084
- name,
1085
- boundingBox,
1086
- elementClass,
1087
- mags,
1088
- largestSegmentId,
1089
- mappings,
1090
- defaultViewConfiguration,
1091
- adminViewConfiguration,
1092
- coordinateTransformations,
1093
- numChannels,
1094
- additionalAxes,
1095
- df
1096
- )
1097
- case DataFormat .zarr3 =>
1098
- Zarr3SegmentationLayer (
1099
- name,
1100
- boundingBox,
1101
- elementClass,
1102
- mags,
1103
- largestSegmentId,
1104
- mappings,
1105
- defaultViewConfiguration,
1106
- adminViewConfiguration,
1107
- coordinateTransformations,
1108
- numChannels,
1109
- additionalAxes
1110
- )
1111
- }
1112
- case None => ???
1113
- }
1114
- case _ => throw new NotImplementedError (" DataLayer type mismatch (unreachable)" )
1115
- }
1116
- }
1117
- } yield layersWithMags
958
+
1118
959
1119
960
private def insertLayerQuery (datasetId : ObjectId , layer : DataLayer ): SqlAction [Int , NoStream , Effect ] =
1120
961
layer match {
0 commit comments