Add profile 3D preferences and adapt DICOM preview resolution to memory budget
This commit is contained in:
1 parent
705762d57c
commit
7fd7ae6733
22 files changed
+500
-68
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package users
|
||||
|
||||
type Dicom3DSettings struct {
|
||||
MemoryMiB int `json:"memoryMiB"`
|
||||
Quality string `json:"quality"`
|
||||
Opacity int `json:"opacity"`
|
||||
}
|
||||
|
||||
func (s Dicom3DSettings) Normalized() Dicom3DSettings {
|
||||
if s.MemoryMiB == 0 {
|
||||
s.MemoryMiB = 1536
|
||||
}
|
||||
if s.Quality == "" {
|
||||
s.Quality = "auto"
|
||||
}
|
||||
if s.Opacity == 0 {
|
||||
s.Opacity = 30
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func (s Dicom3DSettings) Valid() bool {
|
||||
s = s.Normalized()
|
||||
return s.MemoryMiB >= 128 && s.MemoryMiB <= 1536 && s.Opacity >= 5 && s.Opacity <= 100 &&
|
||||
(s.Quality == "auto" || s.Quality == "original" || s.Quality == "half" || s.Quality == "quarter")
|
||||
}
|
||||
Reference in new issue
Block a user