HealthBioscienceIDEAS / Medical-Image-Registration-Short-Course

⚕️Short Course on Medical Image Registration
https://healthbioscienceideas.github.io/Medical-Image-Registration-Short-Course/
Other
3 stars 0 forks source link

Previewing episodes with R in windows #8

Closed mxochicale closed 5 months ago

mxochicale commented 5 months ago

Setting up sandpaper in Ubuntu 22.04 x64

Steps

  1. Create new repo: https://github.com/HealthBioscienceIDEAS/Medical-Image-Registration-Short-Course
  2. Clone repo git clone https://github.com/HealthBioscienceIDEAS/Medical-Image-Registration-Short-Course
  3. install R (if you haven't done already) :link:
    
    sudo apt-get install r-cran-xml
    sudo apt-get install libxml2-dev
    sudo apt install libgit2-dev
    sudo apt install r-cran-curl
4. Open R and run the following to install dependencies

options(repos = c( carpentries = "https://carpentries.r-universe.dev/", CRAN = "https://cran.rstudio.com/" )) install.packages(c("remotes"), dep =TRUE)


5. In R, run 

remotes::install_github("HealthBioscienceIDEAS/sandpaper", dependencies = TRUE)

this one is taking some 20mins the fist time as it seems is building various packages

Terminal logs

Downloading GitHub repo HealthBioscienceIDEAS/sandpaper@HEAD These packages have more recent versions available. It is recommended to update all of them. Which would you like to update?

1: All
2: CRAN packages only
3: None
4: pegboard (0.7.5 -> a32a7836d...) [GitHub] 5: varnish (1.0.2 -> 56d594d27...) [GitHub] 6: curl (4.3.2 -> 5.2.1 ) [CRAN]
7: httr (1.4.2 -> 1.4.7 ) [CRAN]
8: gh (1.3.0 -> 1.4.1 ) [CRAN]
9: covr (3.5.1 -> 3.6.4 ) [CRAN]

Enter one or more numbers, or an empty line to skip updates: 1

The downloaded source packages are in ‘/tmp/Rtmpn94NAu/downloaded_packages’ Downloading GitHub repo carpentries/pegboard@HEAD These packages have more recent versions available. It is recommended to update all of them. Which would you like to update?

1: All
2: CRAN packages only
3: None
4: tinkr (0.2.0.9000 -> be564d524...) [GitHub]

Enter one or more numbers, or an empty line to skip updates: 1

── R CMD build ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ✔ checking for file ‘/tmp/Rtmpn94NAu/remotes50ddb31b7ca85/HealthBioscienceIDEAS-sandpaper-fb14e02/DESCRIPTION’ ... ─ preparing ‘sandpaper’: ✔ checking DESCRIPTION meta-information ... ─ checking for LF line-endings in source and make files and shell scripts (420ms) ─ checking for empty or unneeded directories Omitted ‘LazyData’ from DESCRIPTION ─ building ‘sandpaper_0.16.4.tar.gz’

Installing package into ‘/home/mxochicale/R/x86_64-pc-linux-gnu-library/4.4’ (as ‘lib’ is unspecified)


6. In R, run 

sandpaper::create_lesson("~/Desktop/medical-registration/Medical-Image-Registration-Short-Course")

LOGS

sandpaper::create_lesson("~/Desktop/medical-registration/Medical-Image-Registration-Short-Course") No personal access token (PAT) available.gistration/Medical-Image-Registration-Short-Course... Obtain a PAT from here: https://github.com/settings/tokens For more on what to do with the PAT, see ?gh_whoami. ℹ No schedule set, using Rmd files in episodes/ directory. → To remove this message, define your schedule in config.yaml or use set_episodes() to generate it. ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ℹ To save this configuration, use

set_episodes(path = path, order = ep, write = TRUE) • Edit '/home/mxochicale/Desktop/medical-registration/Medical-Image-Registration-Short-Course/episodes/introduction.Rmd' ✔ First episode created in /home/mxochicale/Desktop/medical-registration/Medical-Image-Registration-Short-Course/episodes/introduction.Rmd ℹ Workflows up-to-date! ✔ Lesson successfully created in ~/Desktop/medical-registration/Medical-Image-Registration-Short-Course ✔ Setting active project to '/home/mxochicale/Desktop/medical-registration/Medical-Image-Registration-Short-Course' ✔ Changing working directory to '/home/mxochicale/Desktop/medical-registration/Medical-Image-Registration-Short-Course/' ~/Desktop/medical-registration/Medical-Image-Registration-Short-Course

  1. Setting up config file in sandpaper template:

    carpentry: 'IDEAS'
    title: ''Medical-Image-Registration-Short-Course'
    created: '2024-05-13'
    source: 'https://github.com/HealthBioscienceIDEAS/Medical-Image-Registration-Short-Course'
    varnish: 'HealthBioscienceIDEAS/varnish@IDEAS'
    sandpaper: 'HealthBioscienceIDEAS/sandpaper@IDEAS'
  2. Set up GitHub Pages

mxochicale commented 5 months ago
  1. Installing R https://cran.r-project.org/bin/windows/base/
  2. options(repos = c( carpentries = "https://carpentries.r-universe.dev/", CRAN = "https://cran.rstudio.com/" )) install.packages(c("remotes"), dep =TRUE)
  3. Change paths using R Console
  4. sandpaper::build_lesson()
zsenousy commented 5 months ago

INSTRUCTIONS for installing R, Carpentries, and Sandpaper on Windows:

  1. Create new repo: https://github.com/HealthBioscienceIDEAS/Medical-Image-Registration-Short-Course

  2. Clone repo git clone https://github.com/HealthBioscienceIDEAS/Medical-Image-Registration-Short-Course

  3. Installing R using the following: https://cran.r-project.org/bin/windows/base/

  4. Using the default settings during the installation of RGUi 4.x.x

  5. From RGui Console, enter the following command:

    options(repos = c(
    carpentries = "https://carpentries.r-universe.dev/",
    CRAN = "https://cran.rstudio.com/"
    ))
  6. Enter the following command: remotes::install_github("HealthBioscienceIDEAS/sandpaper", dependencies = TRUE)

  7. Change path from RGUi to the GitHub folder of the medical image registration course. This is done from the Menu list by picking 'File' then 'Change Dir..'

  8. Run the following command to start sandpaper: sandpaper::build_lesson()

  9. You may notice some package not installed called Pandoc after running the sandpaper command. If so, install Pandoc then run step 8 again. Pandoc installation: https://pandoc.org/installing.html

mxochicale commented 5 months ago

Hi @jamie-mcclelland

RE: https://github.com/HealthBioscienceIDEAS/Medical-Image-Registration-Short-Course/pull/5#issuecomment-2149477503 Let's solve it in this issue as Pull Requests (PRs) are generally for reviewing purposes.

I think you are missing install.packages(c("remotes"), dep =TRUE), can you try (which is in step 4 of the linux section)

options(repos = c(
carpentries = "https://carpentries.r-universe.dev/",
CRAN = "https://cran.rstudio.com/"
))
install.packages(c("remotes"), dep =TRUE)
jamie-mcclelland commented 5 months ago

Hi @mxochicale - I have now been able to build the sandpaper lesson for the itksnap exercises, but ran into some issues along the way: steps 1 and 2 (creating and cloning the repo) are missing from the windows instructions I had to do step 7 to install pandocs, but then I had to restart R so it could find pandocs on the path (without restarting it said it still couldn't find it) when I initially built the lesson I was on the master branch so the itksnap exercises were missing - I figures out I needed to switch the branch, and then it built the lesson fine, but this is not currently mentioned in the instructions. I will now review the exercises themselves and provide my comments on the pull request