Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display biolucida images in gallery based on scicrunch #152

Merged
merged 4 commits into from
Jul 10, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions components/ImagesGallery/ImagesGallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -517,13 +517,21 @@ export default {
immediate: true,
handler: function(biolucidaData) {
const biolucida2DItems = pathOr([], ['dataset_info','biolucida-2d'], biolucidaData)
const biolucida3DItems = pathOr([], ['dataset_info','biolucida-3d'], biolucidaData)
let items = []
const baseRoute = this.$router.options.base || '/'
if ('dataset_images' in biolucidaData) {
const validBiolucidaData = biolucidaData.dataset_images.filter(bObject => {
return (
biolucida2DItems.some(b2DItem => pathOr("", ['biolucida', 'identifier'], b2DItem) == bObject.image_id) ||
biolucida3DItems.some(b3DItem => pathOr("", ['biolucida', 'identifier'], b3DItem) == bObject.image_id)
)
})
const uniqueBiolucidaData = validBiolucidaData.filter((bObject, index) => {
return index == validBiolucidaData.findIndex(bObject2 => bObject.image_id == bObject2.image_id);
})
items.push(
...Array.from(biolucidaData.dataset_images.filter((obj, index) => {
return index === biolucidaData.dataset_images.findIndex(o => obj.image_id === o.image_id);
}), dataset_image => {
...Array.from(uniqueBiolucidaData, dataset_image => {
let filePath = ""
biolucida2DItems.forEach(biolucida2DItem => {
if (pathOr("", ['biolucida','identifier'], biolucida2DItem) == dataset_image.image_id) {
Expand Down
Loading