Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
siibra-explorer
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xiao Gui
siibra-explorer
Commits
b8099e69
Commit
b8099e69
authored
4 years ago
by
Xiao Gui
Browse files
Options
Downloads
Patches
Plain Diff
fix unit test
parent
e1f5a714
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ui/parcellationRegion/region.base.spec.ts
+8
-2
8 additions, 2 deletions
src/ui/parcellationRegion/region.base.spec.ts
src/ui/parcellationRegion/region.base.ts
+2
-2
2 additions, 2 deletions
src/ui/parcellationRegion/region.base.ts
with
10 additions
and
4 deletions
src/ui/parcellationRegion/region.base.spec.ts
+
8
−
2
View file @
b8099e69
...
...
@@ -328,16 +328,22 @@ const getRegionInOtherTemplateSelectorBundle = (version: EnumParcRegVersion) =>
describe
(
'
> region.base.ts
'
,
()
=>
{
describe
(
'
> regionInOtherTemplateSelector
'
,
()
=>
{
// TODO
it
(
'
> only selects region in the template specified by selected atlas
'
)
for
(
const
enumKey
of
Object
.
keys
(
EnumParcRegVersion
))
{
describe
(
`> selector version for
${
enumKey
}
`
,
()
=>
{
const
{
mockFetchedTemplates
,
mr0
,
mt2
,
mt0
,
mp0
,
mt1
,
mp1h
,
mr0lh
,
mt3
,
mr0rh
}
=
getRegionInOtherTemplateSelectorBundle
(
enumKey
as
EnumParcRegVersion
)
let
selectedAtlas
=
{
templateSpaces
:
mockFetchedTemplates
}
describe
(
'
> no hemisphere selected, simulates big brain cyto map
'
,
()
=>
{
let
result
:
any
[]
beforeAll
(()
=>
{
result
=
regionInOtherTemplateSelector
.
projector
(
mockFetchedTemplates
,
mt0
,
{
region
:
mr0
})
result
=
regionInOtherTemplateSelector
.
projector
(
selectedAtlas
,
mockFetchedTemplates
,
mt0
,
{
region
:
mr0
})
})
it
(
'
> length checks out
'
,
()
=>
{
...
...
@@ -409,7 +415,7 @@ describe('> region.base.ts', () => {
describe
(
'
> hemisphere data selected (left hemisphere), simulates julich-brain in mni152
'
,
()
=>
{
let
result
beforeAll
(()
=>
{
result
=
regionInOtherTemplateSelector
.
projector
(
mockFetchedTemplates
,
mt2
,
{
region
:
mr0lh
})
result
=
regionInOtherTemplateSelector
.
projector
(
selectedAtlas
,
mockFetchedTemplates
,
mt2
,
{
region
:
mr0lh
})
})
it
(
'
> length checks out
'
,
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/ui/parcellationRegion/region.base.ts
+
2
−
2
View file @
b8099e69
...
...
@@ -261,7 +261,7 @@ export const regionInOtherTemplateSelector = createSelector(
viewerStateFetchedTemplatesSelector
,
viewerStateSelectedTemplateSelector
,
(
atlas
,
fetchedTemplates
,
templateSelected
,
prop
)
=>
{
const
atlasTemplateSpacesIds
=
atlas
.
templateSpaces
.
map
(({
[
'
@id
'
]:
id
})
=>
i
d
)
const
atlasTemplateSpacesIds
=
atlas
.
templateSpaces
.
map
(({
[
'
@id
'
]:
id
,
fullId
})
=>
id
||
fullI
d
)
const
{
region
:
regionOfInterest
}
=
prop
const
returnArr
=
[]
...
...
@@ -276,7 +276,7 @@ export const regionInOtherTemplateSelector = createSelector(
const
otherTemplates
=
fetchedTemplates
.
filter
(({
fullId
})
=>
getIdFromFullId
(
fullId
)
!==
selectedTemplateId
)
.
filter
(({
[
'
@id
'
]:
id
})
=>
atlasTemplateSpacesIds
.
includes
(
id
))
.
filter
(({
[
'
@id
'
]:
id
,
fullId
})
=>
atlasTemplateSpacesIds
.
includes
(
id
||
fullId
))
for
(
const
template
of
otherTemplates
)
{
for
(
const
parcellation
of
template
.
parcellations
)
{
const
flattenedRegions
=
flattenRegions
(
parcellation
.
regions
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment