![]() |
![]() |
Section 10: Call Count
In section 6 we reviewed the life cycle of BigChunkLoader
s and SmallChunkCollector
s.
In regular intervals:
- The scheduler selects a patient from the dataset.
- A
BigChunkLoader
extracts a big chunk from the patient’s records. TheBigChunkLoader
has access to the patient byself.patient
. - The extracted big chunk is passed to a
SmallChunkCollector
. TheSmallChunkCollector
has access to the patient byself.patient
.
In previous section we introduced the functions set_checkpoint
and get_checkpoint
.
Now we introduce the argument call_count
which is passed to the SmallChunkCollector
.
Once the SmallChunkCollector
starts, the passed call_count
is zero.
The argument call_count
is the number of calls to the SmallChunkCollector
’s extract_smallchunk
function
since the SmallChunkCollector
has started working.
class SampleSmallchunkCollector(SmallChunkCollector):
@abstractmethod
def extract_smallchunk(self, call_count, bigchunk, last_message_fromroot):
'''
Inputs:
- call_count: The number of calls to `extract_smallchunk`
since the `SmallChunkCollector` has started working.
- bigchunk: introduces before.
- last_message_fromroot: to be covered.
'''
'''
.
.
.
same as before
.
.
.
'''
return smallchunk
Please note that unlike a “checkpoint”, the call_count
argument is related to the SmallChunkCollector
rather than the Patient
.
Here is a sample notebook
that combines call_count
, set_checkpoint
and get_checkpoint
to explore each whole-slide-image in a circular path.
Here are the results (high-quality .eps images are provided in this folder):
![]() |
![]() |