Package: rplatypus 0.3.0

rplatypus: Computer Vision for Medical Imaging

Semantic segmentation and object detection for medical images, from a folder of pictures to a trained model and a figure, in a handful of lines or one configuration file. Architectures, losses and training run on 'PyTorch' through 'pyplatypus', a 'Python' package which is installed and isolated automatically; nothing has to be set up by hand. R keeps the parts that make an analysis fast - reading and combining masks, drawing boxes, plotting, comparing models.

Authors:Michal Maj [aut, cre]

rplatypus_0.3.0.tar.gz
rplatypus_0.3.0.zip(r-4.7-any)rplatypus_0.3.0.zip(r-4.6-any)rplatypus_0.3.0.zip(r-4.5-any)
rplatypus_0.3.0.tgz(r-4.6-any)rplatypus_0.3.0.tgz(r-4.5-any)
rplatypus_0.3.0.tar.gz(r-4.7-any)rplatypus_0.3.0.tar.gz(r-4.6-any)
rplatypus_0.3.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
rplatypus/json (API)

# Install 'rplatypus' in R:
install.packages('rplatypus', repos = c('https://maju116.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/maju116/rplatypus/issues

Pkgdown/docs site:https://maju116.github.io

On CRAN:

Conda:

deep-learningdicomimage-segmentationmedical-imagingniftiobject-detectionreticulatetorchunet

7.86 score 136 stars 19 scripts 8 downloads 120 exports 27 dependencies

Last updated from:52534ef353. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK234
source / vignettesOK272
linux-releaseOK222
macos-releaseOK178
macos-oldrelOK142
windows-develOK183
windows-releaseOK182
windows-oldrelOK178
wasm-releaseOK99

Exports:augmentation_stepavailable_callbacksavailable_decodingsavailable_lossesavailable_metricsavailable_modelsavailable_optimizersavailable_separationsavailable_tasksavailable_transformsavailable_weightsbinary_colormapbinary_labelscallback_cosine_annealingcallback_csv_loggercallback_early_stoppingcallback_emacallback_linear_annealingcallback_model_checkpointcallback_reduce_lr_on_plateaucallback_step_decaycallback_stop_aftercallback_swacallback_terminate_on_collapsecallback_terminate_on_nanclass_balanceclasses_to_coloursclassification_dataclassifiercolours_to_classesct_windowsdecode_connected_componentsdecode_follow_flowsdecode_nearest_seeddecode_watersheddetection_anchorsdetection_cropsdetection_datadrawing_styleellipse_measureevaluateevaluate_casesevaluate_classesevaluate_imagesexport_weightsflow_to_coloursinspect_masksinstance_datainstance_shapesinstance_sizeslinknetloss_boundaryloss_cceloss_cce_diceloss_comboloss_diceloss_focalloss_focal_tverskyloss_generalized_diceloss_iouloss_l1loss_lovaszloss_mseloss_smooth_l1loss_tverskymask_coveragemask_volumemetric_accuracymetric_aucmetric_balanced_accuracymetric_cldicemetric_dicemetric_f1metric_ioumetric_surface_dicemetric_tverskyoptimizer_adadeltaoptimizer_adagradoptimizer_adamoptimizer_adamaxoptimizer_adamwoptimizer_nadamoptimizer_rmspropoptimizer_sgdoverlay_agreementoverlay_instance_agreementoverlay_instancesoverlay_maskplatypus_deviceplatypus_factplatypus_fitplatypus_specplatypus_statusplatypus_use_torchplot_anchorsplot_boxesplot_masksread_imagesread_masksread_recordres_u_netsave_class_maskssave_class_volumessave_maskssave_specsave_volumessegmentation_dataseparation_flowsseparation_rimseries_reportsplit_datasetsplit_pathtraining_historyu_netu_net_plus_plusunite_masksvoc_colormapvoc_labelsvolume_infoyolo3

Dependencies:clicpp11farverggplot2gluegtablehereisobandjsonlitelabelinglatticelifecycleMatrixpngR6rappdirsRColorBrewerRcppRcppTOMLreticulaterlangrprojrootS7scalesvctrsviridisLitewithr

Naming what a detector found
Cutting the objects out, which is a decision about the data | A crop needs a label, and the label is a decision | What the detector already answers | The classifier, and the metric that is not accuracy | Scoring per class, because the mean is the commonest class | Two things that do not help, measured rather than assumed | The class that is not a picture of anything | What this does not do | Notes on the machine

Last update: 2026-11-05
Started: 2026-11-05

Finding blood cells with YOLOv3
Before any of that: boxes in a few lines | And here, unlike the nuclei vignette, a score means something | One refusal worth meeting now | Anchors, which a detector has and a U-Net does not | What the loss is doing | Scoring, and the number that is missing on purpose | [email protected], mAP@[.50:.95], and which to believe | Looking at it | What this does not do | Notes on the machine

Last update: 2026-11-05
Started: 2026-10-04

Writing a configuration
One file, one run | Several models at once | Dividing one folder | Augmentation, callbacks, and the rest of a model | Overlapping classes instead of one per voxel | When the overlap was drawn separately: classes_from | Instances instead of one mask | Detection instead of segmentation | One label instead of a mask | When the label is a set: labels_from | Predicting on images you have no labels for | Not training at all | What is checked, and when | The same run from code

Last update: 2026-10-28
Started: 2026-10-07

A fetal head circumference: the measurement a Dice cannot see
Why a circumference is not a score | The data | Splitting by examination, not by image | The specification | Training | From a mask to a millimetre | What the annotation costs before the model does | The Dice cannot see this error | What this does not settle | Notes on the machine

Last update: 2026-10-27
Started: 2026-10-25

Finding nuclei in the 2018 Data Science Bowl
Before any of that: a mask in four lines | The data | Look at it before training on it | The specification | Train | Compare | Look at what it did | The same thing from a file | A note on older graphics cards

Last update: 2026-10-27
Started: 2026-09-26

Retinal vessels: tiling, and a metric Dice cannot replace
Why a vessel cannot be resized | The data | The configuration | Training | One number hides the finding | clDice beside Dice | The worst case, drawn | Two of those choices, measured afterwards | The loss is a decision, and this configuration already had the right one | A surface loss is the one that breaks the lines, and it gets worse with the dose | Tiling against resizing, where this document's first section is too strong | The rig, which is worth more than the ranking | What none of this says | Notes

Last update: 2026-10-27
Started: 2026-10-09

Segmenting volumes: CT, spacing and per-patient scores
Making something to segment | Splitting by patient, not by scan | The specification | Training | Scores per patient, not per dataset | Looking at a slice | Millilitres, not voxels | Writing a mask back onto its scan | DICOM, which is how the data usually arrives | What this leaves out

Last update: 2026-10-27
Started: 2026-09-26

Telling touching nuclei apart
Before any of that: objects in four lines | The semantic sibling, side by side | The data | The specification, with the borrowed model beside a new one | Train | Compare | What this does not settle, measured rather than guessed | Which objects, not how many pixels | A decoding changed without retraining | What it was for: a count and a size distribution | And what shape, which needs no scale at all | The same thing from a file | A note on older graphics cards

Last update: 2026-10-26
Started: 2026-10-15

Readme and manuals

Help Manual

Help pageTopics
Turn a specification back into plain R dataas.list.platypus_spec
An augmentation stepaugmentation_step
What this package can do, asked of the packageavailable_callbacks available_components available_decodings available_losses available_metrics available_models available_optimizers available_separations available_tasks
Which augmentations are availableavailable_transforms
The published weights, and what they areavailable_weights
Average the weights over the last part of the runcallback_swa
Callbackscallbacks callback_cosine_annealing callback_csv_logger callback_early_stopping callback_ema callback_linear_annealing callback_model_checkpoint callback_reduce_lr_on_plateau callback_step_decay callback_stop_after callback_terminate_on_collapse callback_terminate_on_nan
How many images each class has, before anything is trainedclass_balance
Paint a mask with its colormapclasses_to_colours
Images and the label each of them carries, which may be a setclassification_data
Metrics for one label per imageclassification_metrics metric_accuracy metric_auc metric_balanced_accuracy metric_f1
A contracting path, pooled, with one dense layer on topclassifier
Colormaps and their labelsbinary_colormap binary_labels colormaps voc_colormap voc_labels
Read a colour mask back to class indicescolours_to_classes
The named CT windowsct_windows
How predicted channels become objectsdecode_connected_components decode_follow_flows decode_nearest_seed decode_watershed decodings
The anchors a detector used, and whether they were fitteddetection_anchors
Cut every detection out of the image it was found indetection_crops
Where the images and their annotation files aredetection_data
The decisions a drawing makesdrawing_style
The ellipse a segmented structure implies, in millimetresellipse_measure
Pretrained encoders, and what they are worthencoders
Compare the trained modelsevaluate evaluate.platypus_fit
Score every case separatelyevaluate_cases evaluate_cases.platypus_fit summary.platypus_cases
Average precision per classevaluate_classes evaluate_classes.platypus_fit
Score every image separatelyevaluate_images evaluate_images.platypus_fit
Save a trained model's weightsexport_weights
A vector field as a picture: hue is the direction, value is the lengthflow_to_colours
What the colormap or labels match in your masksinspect_masks
Data for instance segmentation: tell the objects apart, not just find theminstance_data
What shape each object is, not just how biginstance_shapes
How big each object is, in units somebody can useinstance_sizes
A loss that knows how far a wrong voxel is from the truthloss_boundary
Loss functionslosses loss_cce loss_cce_dice loss_combo loss_dice loss_focal loss_focal_tversky loss_generalized_dice loss_iou loss_l1 loss_lovasz loss_mse loss_smooth_l1 loss_tversky
How much of each class a mask coversmask_coverage
How much of a volume a class occupies, in millilitresmask_volume
Metricsmetrics metric_cldice metric_dice metric_iou metric_surface_dice metric_tversky
Segmentation modelslinknet models res_u_net u_net u_net_plus_plus
Optimisersoptimizers optimizer_adadelta optimizer_adagrad optimizer_adam optimizer_adamax optimizer_adamw optimizer_nadam optimizer_rmsprop optimizer_sgd
Where a prediction and the truth disagreeoverlay_agreement
Found, missed and invented objectsoverlay_instance_agreement
Draw an instance map over its imageoverlay_instances
Lay a mask over the image it belongs tooverlay_mask
When something is wrong: the conditions this package raisesplatypus_conditions
Where the work will happenplatypus_device
One fact about the platypusplatypus_fact
Train the models in a specificationplatypus_fit
Build an experiment specificationplatypus_spec
Is the engine ready?platypus_status
Ask for a particular PyTorch buildplatypus_use_torch
Draw the anchors against the boxes they were fitted toplot_anchors
Draw boxes on imagesplot_boxes
Look at masks beside the images they came fromplot_masks
Plot what happened during trainingplot.platypus_fit
Predict masks, boxes, objects or labelspredict.platypus_fit
Read images as the model sees themread_images
Read mask files as class indicesread_masks
Read what a run wrote down about itselfread_record
Write overlapping classes, one file per classsave_class_masks
Save overlapping classes as one NIfTI per classsave_class_volumes
Write masks to filessave_masks
Write a specification back out as YAMLsave_spec
Save predicted volumes as NIfTIsave_volumes
Where the images and masks aresegmentation_data
What the network predicts, so objects can be told apartseparations separation_flows separation_rim
Check folders of DICOM slices before training on themseries_report
Split a dataset into training, validation and test setssplit_dataset
The files in one part of a splitsplit_path
The epoch-by-epoch recordtraining_history
Combine several binary masks into oneunite_masks
What is in a volume filevolume_info
YOLOv3yolo3