想知道为什么以及何时需要在 datajoint 的自动填充表中的 make/maketuples 函数中将键设置为不同的变量,如此处的文档中所示。
在本例中,零件表 SegmentationROI 定义如下:
%{
# Region of interest resulting from segmentation
-> test.Segmentation
roi : smallint # roi number
---
roi_pixels : longblob # indices of pixels
roi_weights : longblob # weights of pixels
%}
classdef SegmentationROI < dj.Part
properties(SetAccess=protected)
master = test.Segmentation
end
methods
function make(self, key)
image = fetch1(test.Image & key, 'image');
[roi_pixels, roi_weighs] = mylib.segment(image);
for roi=1:length(roi_pixels)
entity = key;
entity.roi_pixels = roi_pixels{roi};
entity.roi_weights = roi_weights{roi};
self.insert(entity)
end
end
end
end
将键重命名为单独的变量实体(实体 = 键)然后插入它的目的是什么?