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

Unending spinning of dataset images #807

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion components/Gallery/GalleryItems/FileViewerCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default {
},
computed: {
isReady() {
return this.data.title && (this.thumbnail || this.useDefaultImg) && (this.data.link || this.data.userData)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we removing the check for the title? Images should have a title associated with them

Copy link
Collaborator Author

@ddjnw1yu ddjnw1yu Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to the failed biolucida requests, the file name will be undefined. The main reason for removing the title check is to avoid unending spinning caused by this. This may cause some inconvenience for people who are doing the portal QC. I updated the existing biolucida testing which will run through all the datasets and help to generate a report of related issues. You will be able to find an example report in this ticket.

return (this.thumbnail || this.useDefaultImg) && (this.data.link || this.data.userData)
},
imageHeight() {
return this.showCardDetails ? this.height * 0.525 : this.height
Expand Down
12 changes: 9 additions & 3 deletions components/ImagesGallery/ImagesGallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,9 @@ export default {
const baseRoute = this.$router.options.base || '/'
if ('dataset_images' in biolucidaData) {
items.push(
...Array.from(biolucidaData.dataset_images, dataset_image => {
...Array.from(biolucidaData.dataset_images.filter((obj, index) => {
return index === biolucidaData.dataset_images.findIndex(o => obj.image_id === o.image_id);
}), dataset_image => {
let filePath = ""
biolucida2DItems.forEach(biolucida2DItem => {
if (pathOr("", ['biolucida','identifier'], biolucida2DItem) == dataset_image.image_id) {
Expand Down Expand Up @@ -782,8 +784,9 @@ export default {
biolucida.getThumbnail(info.id).then(
response => {
let item = items.find(x => x.id === info.id)

this.$set(item, 'thumbnail', 'data:image/png;base64,' + response.data)
if (response.data) {
this.$set(item, 'thumbnail', 'data:image/png;base64,' + response.data)
}
},
reason => {
if (
Expand All @@ -808,6 +811,9 @@ export default {
const name = response.name
if (name) {
this.$set(item, 'title', name.substring(0, name.lastIndexOf('.')))
if (name.lastIndexOf('.') === -1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is happening because we are removing the check for the title. I believe every image should have a title. If an image does not have one, we need to figure out why biolucida is not returning one

Copy link
Collaborator Author

@ddjnw1yu ddjnw1yu Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change here is because of the file name structure. The original code's default file name format should end with a suffix, e.g. .jp2 in Dog 20X Caspase-3 (1).jp2. However, in some datasets, the file name will not have the suffix (some other reason caused this). name.substring(0, name.lastIndexOf('.')) will be an empty string. For example, some image files in dataset 178 (the issue is caught in the above example report).

this.$set(item, 'title', name)
}
}
},
reason => {
Expand Down
Loading