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
97fdb126
Commit
97fdb126
authored
1 year ago
by
Xiao Gui
Browse files
Options
Downloads
Patches
Plain Diff
fix: ATP selection bug
parent
ddeb3709
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/state/atlasSelection/effects.ts
+16
-2
16 additions, 2 deletions
src/state/atlasSelection/effects.ts
with
16 additions
and
2 deletions
src/state/atlasSelection/effects.ts
+
16
−
2
View file @
97fdb126
...
...
@@ -2,7 +2,7 @@ import { Injectable } from "@angular/core";
import
{
Actions
,
createEffect
,
ofType
}
from
"
@ngrx/effects
"
;
import
{
forkJoin
,
from
,
NEVER
,
Observable
,
of
,
throwError
}
from
"
rxjs
"
;
import
{
catchError
,
filter
,
map
,
mapTo
,
switchMap
,
take
,
withLatestFrom
}
from
"
rxjs/operators
"
;
import
{
SAPI
}
from
"
src/atlasComponents/sapi
"
;
import
{
IDS
,
SAPI
}
from
"
src/atlasComponents/sapi
"
;
import
*
as
mainActions
from
"
../actions
"
import
{
select
,
Store
}
from
"
@ngrx/store
"
;
import
{
selectors
,
actions
,
fromRootStore
}
from
'
.
'
...
...
@@ -286,7 +286,13 @@ export class Effect {
if
(
autoSelect
)
{
atlas
||=
atlas
[
0
]
template
||=
result
.
spaces
.
find
(
s
=>
s
.
name
.
includes
(
"
152
"
))
||
result
.
spaces
[
0
]
template
||=
result
.
spaces
.
find
(
s
=>
s
.
id
===
IDS
.
TEMPLATES
.
MNI152
)
||
result
.
spaces
[
0
]
// on template selection, the possible parcellation may be narrowed
// as a result, we need to run the collapser to reduce the possible selection
const
newPosATP
=
await
this
.
collapser
.
collapseTemplateId
(
template
.
id
)
const
{
parcellations
}
=
DecisionCollapse
.
Intersect
(
newPosATP
,
result
)
result
.
parcellations
=
parcellations
const
parcPrevIds
=
result
.
parcellations
.
map
(
p
=>
p
.
prevId
)
const
latestParcs
=
result
.
parcellations
.
filter
(
p
=>
!
parcPrevIds
.
includes
(
p
.
id
))
...
...
@@ -299,6 +305,14 @@ export class Effect {
if
(
!
atlas
)
return
// user cancelled
template
||=
await
this
.
#
askUserATP
(
messages
.
template
||
"
Please select a space
"
,
result
.
spaces
).
toPromise
()
if
(
!
template
)
return
// user cancelled
// on template selection, the possible parcellation may be narrowed
// as a result, we need to run the collapser to reduce the possible selection
const
newPosATP
=
await
this
.
collapser
.
collapseTemplateId
(
template
.
id
)
const
{
parcellations
}
=
DecisionCollapse
.
Intersect
(
newPosATP
,
result
)
result
.
parcellations
=
parcellations
parcellation
||=
await
this
.
#
askUserATP
(
messages
.
parcellation
||
"
Please select a parcellation
"
,
result
.
parcellations
).
toPromise
()
if
(
!
parcellation
)
return
// user cancelled
...
...
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