Skip to content

Commit

Permalink
connect the old mbf images, non vagus
Browse files Browse the repository at this point in the history
  • Loading branch information
SamanthaKraft committed Jul 9, 2024
1 parent 640ea0f commit 2234015
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
14 changes: 9 additions & 5 deletions src/components/ImageSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ function selectImage(index){
emitter.on('MBFImageArray-Update',(imageArray)=>{
//buildDataTable
imageArray.value = new TableObject(imageArray);
//imageArray.value = new TableObject(imageArray);
TableData.value = imageArray.value.buildTableMBF();
//TableData.value = imageArray.value.buildTableMBF();
getImagesFromDataset();
});
//on update
const getImagesFromDataset = async (datasetId)=>{
Expand All @@ -61,16 +62,19 @@ const getImagesFromDataset = async (datasetId)=>{
if (_response.status === 200) {
_biolucidaImageData = _response;
//buildTable needs to belong to ImageModel/s
buildDataTable(Object.assign(new Dataset(_biolucidaImageData.data.dataset_images)).Imgs);
imageArray.value = new TableObject(_biolucidaImageData.data.dataset_images);
TableData.value = imageArray.value.buildTableSPARC();
//buildDataTable(Object.assign(new TableObject(_biolucidaImageData.data.dataset_images)));
}
}catch(e){
console.error("couldn't fetch images from dataset");
}
}
function buildDataTable(Imgs){
function buildDataTable(tbleObj){
const imgs = tbleObj.SparcImageArray;
let _tempArr=[];
Imgs.forEach((img)=>{
imgs.forEach((img)=>{
let column = {
name:img.ImgName,
size: "...",
Expand Down
17 changes: 16 additions & 1 deletion src/devComponents/ImageSelector/ImageModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ class MBFImageObject {
class SparcImageObject
{
constructor(data){
this.id = data.id;
this.id = data.image_id;
this.name = data.image_id,
this.size = "...",
this.path = data.share_link
}
}
export class TableObject{
Expand All @@ -34,4 +37,16 @@ export class TableObject{
})
return _tempArr;
}
buildTableSPARC(){
let _tempArr=[];
this.SparcImageArray.forEach((img)=>{
let column = {
name:img.id,
size: "...",
path: img.path
}
_tempArr.push(column);
})
return _tempArr;
}
}

0 comments on commit 2234015

Please sign in to comment.