uasolo / landmarkregUtils

Utilities for Landmark Registration
Other
2 stars 0 forks source link

Error in landmarkreg_nocurves #1

Open inigourrestarazu opened 1 year ago

inigourrestarazu commented 1 year ago

Hi, Michelle!

I attended your course organized by Massimiliano Canzi. It was wonderful. Thank you very much! I am trying to apply it to my data, but I cannot make it work.

reg <- landmarkreg_nocurves(inputMarks = land %>% select(starts_with("l")), njobs = 2)

The console returns this: row(s) 1 of inputMarks have nonzero first landmarks

I just fed the first line in the data frame, but it returns the same message for all the rows.

I already substracted the time of l0 from all landmarks, but it returns the same error.

This is the first line of the data frame that gives the error.

structure(list(curve.id = "id_100", l0 = 0, l1 = 0.035, l2 = 0.07, l3 = 0.19), class = c("grouped_df", "tbl_df", "tbl", "data.frame" ), row.names = c(NA, -1L), groups = structure(list(curve.id = "id_100", .rows = structure(list(1L), ptype = integer(0), class = c("vctrs_list_of", "vctrs_vctr", "list"))), class = c("tbl_df", "tbl", "data.frame" ), row.names = c(NA, -1L), .drop = TRUE))

uasolo commented 1 year ago

Hi Iñigo, thanks for attending my workshop! The error is strange. The idea is that inputMarks can be either a matrix or a data frame, but it should contain only numeric values. My example there is based on selecting the columns that start with "l". Maybe in your data frame there's some problem with that. Or the row types are not right. Or it is the grouping that should not be there. Please try manipulating your input, for example turn it into a matrix, check that it is type numeric, and then try again. Keep me posted, and sorry for seeing this msg only now :) Michele

On Wed, Sep 27, 2023 at 9:56 AM Iñigo Urrestarazu-Porta < @.***> wrote:

Hi, Michelle!

I attended your course organized by Massimiliano Canzi. It was wonderful. Thank you very much! I am trying to apply it to my data, but I cannot make it work.

reg <- landmarkreg_nocurves(inputMarks = land %>% select(starts_with("l")), njobs = 2)

The console returns this: row(s) 1 of inputMarks have nonzero first landmarks

I just fed the first line in the data frame, but it returns the same message for all the rows.

I already substracted the time of l0 from all landmarks, but it returns the same error.

This is the first line of the data frame that gives the error.

structure(list(curve.id = "id_100", l0 = 0, l1 = 0.035, l2 = 0.07, l3 = 0.19), class = c("grouped_df", "tbl_df", "tbl", "data.frame" ), row.names = c(NA, -1L), groups = structure(list(curve.id = "id_100", .rows = structure(list(1L), ptype = integer(0), class = c("vctrs_list_of", "vctrs_vctr", "list"))), class = c("tbl_df", "tbl", "data.frame" ), row.names = c(NA, -1L), .drop = TRUE))

— Reply to this email directly, view it on GitHub https://github.com/uasolo/landmarkregUtils/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMVDVGUV6SKZ5FSRS6CG4TX4PL2BANCNFSM6AAAAAA5I5DNGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

inigourrestarazu commented 1 year ago

Hi Michele!

I continued deeping into it.

I guess the problem is with the apply(inputmarks, 1, diff) function in the landmarkreg_nocurves function. The l2 values t(apply(inputmarks, 1, diff)) returned are smaller than the l1 values for most rows. For the row c(l0 = 0, l1 = 0.135, l2 = 0.255, l3 = 0.395) it returns c(l1 = 0.135, l2 = 0.12, l3 = 0.14). I have no clue why.

I continued forward just with l0 and l3. And encountered another error in applyReg with some curves. This is the error message:

Error in dplyr::reframe(): ℹ In argument: valuereg = val_at_treg(...). ℹ In group 28: ID_ = id_60, id_ = "id_60". Caused by error in chol.default(): ! the leading minor of order 29 is not positive

I filtered out the curves that create this problem and could do all the analysis, but did not try yet to check what the problem was with those ones.

Thanks!